File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
overmind/namespaces/editor Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export const sandboxChanged: AsyncAction<{ id: string }> = withLoadApp<{
8686
8787 state . editor . isLoading = ! hasExistingSandbox ;
8888 state . editor . notFound = false ;
89+ state . editor . currentId = newId ;
8990
9091 try {
9192 const sandbox = await effects . api . getSandbox ( newId ) ;
Original file line number Diff line number Diff line change @@ -120,7 +120,25 @@ export const state: State = {
120120 devToolIndex : 0 ,
121121 tabPosition : 0 ,
122122 } ,
123- currentSandbox : ( { sandboxes, currentId } ) => sandboxes [ currentId ] ,
123+ currentSandbox : ( { sandboxes, currentId } ) => {
124+ if ( ! currentId ) {
125+ return undefined ;
126+ }
127+
128+ if ( sandboxes [ currentId ] ) {
129+ return sandboxes [ currentId ] ;
130+ }
131+
132+ return {
133+ id : currentId ,
134+ alias : '' ,
135+ title : '' ,
136+ description : '' ,
137+ modules : [ ] ,
138+ directories : [ ] ,
139+ privacy : 0 ,
140+ } ;
141+ } ,
124142 isAllModulesSynced : ( { changedModuleShortids } ) =>
125143 ! changedModuleShortids . length ,
126144 currentModule : ( { currentSandbox, currentModuleShortid } ) =>
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export const Sandbox: React.FC<Props> = ({ match }) => {
115115 return < NotFound /> ;
116116 }
117117
118- if ( state . editor . isLoading || ! state . editor . currentSandbox ) {
118+ if ( ! state . editor . currentId ) {
119119 return (
120120 < >
121121 < Skeleton
You can’t perform that action at this time.
0 commit comments