File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,9 @@ export function useStore(
6464 }
6565
6666 function init ( ) {
67- watchEffect ( ( ) =>
68- compileFile ( store , activeFile . value ) . then (
69- ( errs ) => ( errors . value = errs ) ,
70- ) ,
71- )
67+ watchEffect ( ( ) => {
68+ compileFile ( store , activeFile . value ) . then ( ( errs ) => ( errors . value = errs ) )
69+ } )
7270
7371 watch (
7472 ( ) => [
@@ -218,8 +216,11 @@ export function useStore(
218216 if ( mainFile . value === oldFilename ) {
219217 mainFile . value = newFilename
220218 }
221-
222- compileFile ( store , file ) . then ( ( errs ) => ( errors . value = errs ) )
219+ if ( activeFilename . value === oldFilename ) {
220+ activeFilename . value = newFilename
221+ } else {
222+ compileFile ( store , file ) . then ( ( errs ) => ( errors . value = errs ) )
223+ }
223224 }
224225 const getImportMap : Store [ 'getImportMap' ] = ( ) => {
225226 try {
You can’t perform that action at this time.
0 commit comments