Skip to content

Commit b5db02a

Browse files
committed
Fix invalid parse on package for server
1 parent 8e2751c commit b5db02a

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Server/Tasks.js renamed to packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Server/Tasks.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ const Task = styled.button`
3737
`;
3838

3939
type Props = {
40-
package: ?{
41-
scripts: {
42-
[command: string]: string,
43-
},
44-
},
40+
package:
41+
| {
42+
scripts: {
43+
[command: string]: string;
44+
};
45+
}
46+
| undefined;
4547
};
4648

4749
// These scripts are only supposed to run on the main thread.

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Server/index.js renamed to packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Server/index.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ const SubTitle = styled.div`
2323
font-size: 0.875rem;
2424
`;
2525

26-
function Server({ store }) {
27-
const { parsed } = store.editor.parsedConfigurations.package;
26+
function Server({ store }: { store: any }) {
2827
const disconnected = store.server.status !== 'connected';
2928

3029
return (
@@ -55,7 +54,12 @@ function Server({ store }) {
5554
opacity: disconnected ? 0.5 : 1,
5655
}}
5756
>
58-
<Tasks package={parsed} />
57+
<Tasks
58+
package={
59+
store.editor.parsedConfigurations.package &&
60+
store.editor.parsedConfigurations.package.parsed
61+
}
62+
/>
5963
</WorkspaceInputContainer>
6064
</Margin>
6165
</Margin>
@@ -78,10 +82,12 @@ function Server({ store }) {
7882
dispatch({ type: 'socket:message', channel: 'sandbox:restart' });
7983
}}
8084
>
81-
<PowerIcon
82-
style={{ fontSize: '1.125em', marginRight: '.25rem ' }}
83-
/>{' '}
84-
Restart Sandbox
85+
<React.Fragment>
86+
<PowerIcon
87+
style={{ fontSize: '1.125em', marginRight: '.25rem ' }}
88+
/>{' '}
89+
Restart Sandbox
90+
</React.Fragment>
8591
</Button>
8692
</WorkspaceInputContainer>
8793
<WorkspaceInputContainer>
@@ -106,10 +112,12 @@ function Server({ store }) {
106112
});
107113
}}
108114
>
109-
<PowerIcon
110-
style={{ fontSize: '1.125em', marginRight: '.25rem ' }}
111-
/>{' '}
112-
Restart Server
115+
<React.Fragment>
116+
<PowerIcon
117+
style={{ fontSize: '1.125em', marginRight: '.25rem ' }}
118+
/>{' '}
119+
Restart Server
120+
</React.Fragment>
113121
</Button>
114122
</WorkspaceInputContainer>
115123
</Margin>

0 commit comments

Comments
 (0)