File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed
packages/app/src/app/store/entities/sandboxes Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change 2
2
import { schema } from 'normalizr' ;
3
3
import { getSandboxOptions } from 'common/url' ;
4
4
5
- import { findMainModule } from './modules/selectors' ;
5
+ import { findMainModule , findCurrentModule } from './modules/selectors' ;
6
6
import moduleEntity from './modules/entity' ;
7
7
import directoryEntity from './directories/entity' ;
8
8
import userEntity from '../users/entity' ;
@@ -18,25 +18,34 @@ export default new schema.Entity(
18
18
{
19
19
processStrategy : sandbox => {
20
20
const {
21
- currentModule = findMainModule (
22
- sandbox . modules ,
23
- sandbox . directories ,
24
- sandbox . entry
25
- ) ,
21
+ currentModule,
26
22
initialPath,
27
23
isInProjectView,
28
24
isEditorScreen,
29
25
isPreviewScreen,
30
26
} = getSandboxOptions ( document . location . href ) ;
31
27
28
+ const mainModule = findMainModule (
29
+ sandbox . modules ,
30
+ sandbox . directories ,
31
+ sandbox . entry
32
+ ) ;
33
+
34
+ const resolvedCurrentModule = findCurrentModule (
35
+ sandbox . modules ,
36
+ sandbox . directories ,
37
+ currentModule ,
38
+ mainModule
39
+ ) ;
40
+
32
41
return {
33
42
...sandbox ,
34
43
isInProjectView,
35
44
showEditor : ! isPreviewScreen ,
36
45
showPreview : ! isEditorScreen ,
37
- currentModule,
46
+ currentModule : resolvedCurrentModule ,
38
47
initialPath,
39
- tabs : [ currentModule ]
48
+ tabs : [ resolvedCurrentModule ]
40
49
. filter ( x => x )
41
50
. map ( m => ( { moduleId : m . id , dirty : true } ) ) ,
42
51
forcedRenders : 0 , // used to force renders
You can’t perform that action at this time.
0 commit comments