File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
overmind/namespaces/editor/models
pages/Sandbox/Editor/Workspace
Files/DirectoryEntry/DirectoryChildren
screens/Explorer/Files/DirectoryEntry/DirectoryChildren Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 66 resolveModule ,
77 resolveModuleWrapped ,
88} from '@codesandbox/common/lib/sandbox/modules' ;
9+ import { hasPermission } from '@codesandbox/common/lib/utils/permission' ;
910import getTemplate , { TemplateType } from '@codesandbox/common/lib/templates' ;
1011import { generateFileFromSandbox } from '@codesandbox/common/lib/templates/configuration/package-json' ;
1112import {
@@ -69,8 +70,8 @@ export class EditorSandbox {
6970
7071 private currentModuleShortid : string | null = null ;
7172 private changedModuleShortids : string [ ] = [ ] ;
72- public errors : ModuleError [ ] ;
73- public corrections : ModuleCorrection [ ] ;
73+ public errors : ModuleError [ ] = [ ] ;
74+ public corrections : ModuleCorrection [ ] = [ ] ;
7475 private getModuleParents ( modules , directories , shortid ) : string [ ] {
7576 const module = modules . find ( moduleEntry => moduleEntry . shortid === shortid ) ;
7677
@@ -336,7 +337,7 @@ export class EditorSandbox {
336337 }
337338
338339 hasPermission ( permission : PermissionType ) {
339- return this . currentSandbox . authorization === permission ;
340+ return hasPermission ( this . currentSandbox . authorization , permission ) ;
340341 }
341342
342343 toggleLiked ( ) {
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ const DirectoryChildren: React.FC<IDirectoryChildrenProps> = ({
7676 mainModuleId = { mainModule . id }
7777 modules = { modules }
7878 directories = { directories }
79- currentModuleShortid = { currentModule . shortid }
79+ currentModuleShortid = { currentModule ? .shortid }
8080 isInProjectView = { isInProjectView }
8181 markTabsNotDirty = { markTabsNotDirty }
8282 getModulePath = { getModulePath }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ const ModuleEntry: React.FC<IModuleEntryProps> = ({
4343 live,
4444 } ,
4545 } = useOvermind ( ) ;
46- const isActive = module . shortid === currentModule . shortid ;
46+ const isActive = module . shortid === currentModule ? .shortid ;
4747 const isMainModule = module . id === mainModule . id ;
4848 const type = getType ( module . title ) ;
4949 const hasError = module . errors . length > 0 ;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ const DirectoryChildren: React.FC<IDirectoryChildrenProps> = ({
7676 mainModuleId = { mainModule . id }
7777 modules = { modules }
7878 directories = { directories }
79- currentModuleShortid = { currentModule . shortid }
79+ currentModuleShortid = { currentModule ? .shortid }
8080 isInProjectView = { isInProjectView }
8181 markTabsNotDirty = { markTabsNotDirty }
8282 getModulePath = { getModulePath }
You can’t perform that action at this time.
0 commit comments