File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,17 @@ export class App {
6969
7070 await this . state . editorMosaic . set ( editorValues ) ;
7171
72+ // HACK: editors should be mounted shortly after we load something.
73+ // We could try waiting for every single `editorDidMount` callback
74+ // to fire, but that gets complicated with recycled editors with changed
75+ // values. This is just easier for now.
76+ await new Promise < void > ( ( resolve ) =>
77+ setTimeout ( async ( ) => {
78+ await this . state . editorMosaic . markAsSaved ( ) ;
79+ resolve ( ) ;
80+ } , 100 ) ,
81+ ) ;
82+
7283 this . state . gistId = gistId || '' ;
7384 this . state . localPath = localFiddle ?. filePath ;
7485 this . state . templateName = templateName ;
Original file line number Diff line number Diff line change @@ -133,17 +133,6 @@ export class EditorMosaic {
133133 for ( const id of this . editors . keys ( ) ) {
134134 if ( ! values . has ( id ) ) this . editors . delete ( id ) ;
135135 }
136-
137- // HACK: editors should be mounted shortly after we load something.
138- // We could try waiting for every single `editorDidMount` callback
139- // to fire, but that gets complicated with recycled editors with changed
140- // values. This is just easier for now.
141- await new Promise < void > ( ( resolve ) =>
142- setTimeout ( async ( ) => {
143- await this . markAsSaved ( ) ;
144- resolve ( ) ;
145- } , 100 ) ,
146- ) ;
147136 }
148137
149138 /** Add a file. If we already have a file with that name, replace it. */
You can’t perform that action at this time.
0 commit comments