File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
packages/app/src/app/overmind/namespaces/editor Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,13 @@ export const npmDependencyRemoved: AsyncAction<{
6868export const sandboxChanged : AsyncAction < { id : string } > = withLoadApp < {
6969 id : string ;
7070} > ( async ( { state, actions, effects } , { id } ) => {
71+ // This happens when we fork. This can be avoided with state first routing
72+ if ( state . editor . isForkingSandbox ) {
73+ effects . vscode . openModule ( state . editor . currentModule ) ;
74+ state . editor . isForkingSandbox = false ;
75+ return ;
76+ }
77+
7178 await effects . vscode . closeAllTabs ( ) ;
7279
7380 state . editor . error = null ;
@@ -76,11 +83,6 @@ export const sandboxChanged: AsyncAction<{ id: string }> = withLoadApp<{
7683
7784 newId = actions . editor . internal . ensureSandboxId ( newId ) ;
7885
79- // This happens when we fork. This can be avoided with state first routing
80- if ( state . editor . isForkingSandbox ) {
81- return ;
82- }
83-
8486 const hasExistingSandbox = Boolean ( state . editor . currentId ) ;
8587
8688 if ( state . live . isLive ) {
Original file line number Diff line number Diff line change @@ -331,7 +331,6 @@ export const forkSandbox: AsyncAction<{
331331 state . editor . modulesByPath = fs ;
332332 } ) ;
333333
334- effects . vscode . openModule ( state . editor . currentModule ) ;
335334 effects . preview . executeCodeImmediately ( true ) ;
336335
337336 // When not server we "piggyback" the existing Sandbox to avoid any rerenders and need
@@ -353,8 +352,6 @@ export const forkSandbox: AsyncAction<{
353352 console . error ( error ) ;
354353 effects . notificationToast . error ( 'Sorry, unable to fork this sandbox' ) ;
355354 }
356-
357- state . editor . isForkingSandbox = false ;
358355} ;
359356
360357export const setCurrentModule : AsyncAction < Module > = async (
You can’t perform that action at this time.
0 commit comments