Skip to content

Commit 6d05ef3

Browse files
actually loads
1 parent df62724 commit 6d05ef3

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

packages/app/src/app/overmind/namespaces/editor/models/EditorSandbox.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ import { parseConfigurations } from 'app/overmind/utils/parse-configurations';
2626
import { json } from 'overmind';
2727

2828
export class EditorSandbox {
29-
private currentSandbox: Sandbox = {} as Sandbox;
29+
private currentSandbox: Sandbox = {
30+
id: null,
31+
title: 'New',
32+
owned: false,
33+
} as Sandbox;
34+
3035
private currentModuleShortid: string | null = null;
3136
private changedModuleShortids: string[] = [];
3237
public errors: ModuleError[];

packages/app/src/app/overmind/utils/items.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export const SERVER: INavigationItem = {
6565
};
6666

6767
export function getDisabledItems(store: any): INavigationItem[] {
68-
const { currentSandbox } = store.editor;
68+
const { sandbox } = store.editor;
6969

70-
if (!currentSandbox.owned || !store.isLoggedIn) {
70+
if (!sandbox.owned || !store.isLoggedIn) {
7171
return [GITHUB, DEPLOYMENT, LIVE];
7272
}
7373

@@ -77,7 +77,7 @@ export function getDisabledItems(store: any): INavigationItem[] {
7777
export default function getItems(store: any): INavigationItem[] {
7878
if (
7979
store.live.isLive &&
80-
!store.editor.currentSandbox.git &&
80+
!store.editor.sandbox.git &&
8181
!(
8282
store.live.isOwner ||
8383
(store.user &&
@@ -89,27 +89,27 @@ export default function getItems(store: any): INavigationItem[] {
8989
return [FILES, LIVE];
9090
}
9191

92-
const { currentSandbox } = store.editor;
92+
const { sandbox } = store.editor;
9393

94-
if (!currentSandbox.owned) {
94+
if (!sandbox.owned) {
9595
return [PROJECT_SUMMARY, CONFIGURATION];
9696
}
9797

98-
const isCustomTemplate = !!currentSandbox.customTemplate;
98+
const isCustomTemplate = !!sandbox.customTemplate;
9999
const items = [
100100
isCustomTemplate ? PROJECT_TEMPLATE : PROJECT,
101101
FILES,
102102
CONFIGURATION,
103103
];
104104

105-
if (store.isLoggedIn && currentSandbox) {
106-
const templateDef = getTemplate(currentSandbox.template);
105+
if (store.isLoggedIn && sandbox) {
106+
const templateDef = getTemplate(sandbox.template);
107107
if (templateDef.isServer) {
108108
items.push(SERVER);
109109
}
110110
}
111111

112-
if (store.isLoggedIn && currentSandbox && !currentSandbox.git) {
112+
if (store.isLoggedIn && sandbox && !sandbox.git) {
113113
items.push(GITHUB);
114114
}
115115

@@ -119,8 +119,8 @@ export default function getItems(store: any): INavigationItem[] {
119119

120120
if (
121121
store.isLoggedIn &&
122-
currentSandbox &&
123-
hasPermission(currentSandbox.authorization, 'write_code')
122+
sandbox &&
123+
hasPermission(sandbox.authorization, 'write_code')
124124
) {
125125
items.push(LIVE);
126126
}

packages/app/src/app/pages/Sandbox/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export const Sandbox: React.FC<Props> = ({ match }) => {
6161

6262
if (state.editor.error) {
6363
const isGithub = match.params.id.includes('github');
64-
6564
return (
6665
<>
6766
<div

0 commit comments

Comments
 (0)