Skip to content

Commit ffbcd88

Browse files
MichaelDeBoeyCompuIves
authored andcommitted
Resolve discussions (codesandbox#1987)
* Resolve SSEDownNotice discussions * Resolve GitHub discussions * Resolve More discussions
1 parent 2316e33 commit ffbcd88

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/SSEDownNotice/SSEDownNotice.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ import { useStore } from 'app/store';
77
import { Container } from './elements';
88

99
export const SSEDownNotice = observer(() => {
10-
const store = useStore();
10+
const {
11+
editor: {
12+
currentSandbox: { template },
13+
},
14+
server: { status },
15+
} = useStore();
1116

12-
const templateDef = getTemplate(store.editor.currentSandbox.template);
13-
if (!templateDef.isServer) {
17+
if (!getTemplate(template).isServer) {
1418
return null;
1519
}
1620

17-
if (store.server.status !== 'disconnected') {
21+
if (status !== 'disconnected') {
1822
return null;
1923
}
2024

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/GitHub/Git/Git.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ import { WorkspaceSubtitle, WorkspaceInputContainer } from '../../../elements';
1414
import { Container, Buttons, ErrorMessage, NoChanges } from './elements';
1515
import { TotalChanges } from './TotalChanges';
1616

17-
function hasWriteAccess(rights: 'none' | 'read' | 'write' | 'admin') {
18-
return rights === 'write' || rights === 'admin';
19-
}
17+
const hasWriteAccess = (rights: 'none' | 'read' | 'write' | 'admin') =>
18+
['admin', 'write'].includes(rights);
2019

2120
export const Git = observer(() => {
2221
const {

packages/app/src/app/pages/Sandbox/Editor/Workspace/items/More/More.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export const More = observer<Props>(({ id, message }) => {
2323
editor: { isForkingSandbox },
2424
} = useStore();
2525

26-
useEffect(() => track('Workspace - More Opened', { id }), [id]);
26+
useEffect(() => {
27+
track('Workspace - More Opened', { id })
28+
}, [id]);
2729

2830
return (
2931
<div>

0 commit comments

Comments
 (0)