File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Promise.all([
29
29
// dang huge (> 40Mb). In the meantime the textarea that is holding the place
30
30
// of the actual functional one is just going to display "Loading...".
31
31
import ( "./createRuby" ) . then ( ( { default : createRuby } ) => createRuby ( ) )
32
- ] ) . then ( async ( [ editor , mermaid , ruby ] ) => {
32
+ ] ) . then ( ( [ editor , mermaid , ruby ] ) => {
33
33
// First, grab a reference to the output element so that we can update it.
34
34
// Then, set it initially to the output represented by the source.
35
35
const output = document . getElementById ( "output" ) ;
@@ -113,13 +113,10 @@ Promise.all([
113
113
// fetch code from URL
114
114
const params = new URLSearchParams ( document . location . search )
115
115
const sourceURL = params . get ( 'source' )
116
- try {
117
- const response = await fetch ( new URL ( sourceURL ) )
118
- if ( response . status === 200 ) {
119
- const data = await response . text ( )
120
- editor . setValue ( data )
121
- }
122
- } catch ( error ) {
123
- console . error ( error )
116
+ if ( sourceURL ) {
117
+ fetch ( new URL ( sourceURL ) )
118
+ . then ( response => response . text ( ) )
119
+ . then ( data => editor . setValue ( data ) )
120
+ . catch ( error => console . error ( error ) )
124
121
}
125
122
} ) ;
You can’t perform that action at this time.
0 commit comments