Skip to content

Commit e494f03

Browse files
smooth moving to team sandbox and generally going into live mode
1 parent 7a1379b commit e494f03

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

packages/app/src/app/overmind/namespaces/live/internalActions.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ export const initialize: AsyncAction<string, Sandbox> = async (
6767
state.live.roomInfo = roomInfo;
6868
state.live.liveUserId = liveUserId;
6969

70-
if (!state.editor.sandboxes[sandbox.id]) {
70+
if (
71+
!state.editor.currentSandbox ||
72+
state.editor.currentSandbox.id !== sandbox.id
73+
) {
7174
state.editor.sandboxes[sandbox.id] = sandbox;
75+
state.editor.currentId = sandbox.id;
7276
}
73-
state.editor.currentId = sandbox.id;
7477

7578
effects.analytics.track('Live Session Joined', {});
7679
effects.live.listen(actions.live.liveMessageReceived);

packages/app/src/app/pages/Live/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import * as React from 'react';
2-
import { Link } from 'react-router-dom';
3-
import Helmet from 'react-helmet';
4-
import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name';
1+
import Centered from '@codesandbox/common/lib/components/flex/Centered';
52
import Fullscreen from '@codesandbox/common/lib/components/flex/Fullscreen';
63
import Padding from '@codesandbox/common/lib/components/spacing/Padding';
7-
import Centered from '@codesandbox/common/lib/components/flex/Centered';
4+
import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name';
85
import { inject, observer } from 'app/componentConnectors';
9-
import { Title } from 'app/components/Title';
10-
import { SubTitle } from 'app/components/SubTitle';
116
import { Skeleton } from 'app/components/Skeleton';
7+
import { SubTitle } from 'app/components/SubTitle';
8+
import { Title } from 'app/components/Title';
129
import { Navigation } from 'app/pages/common/Navigation';
1310
import { SignInButton } from 'app/pages/common/SignInButton';
1411
import { QuickActions } from 'app/pages/Sandbox/QuickActions';
1512
import { hasAuthToken } from 'app/utils/user';
13+
import * as React from 'react';
14+
import Helmet from 'react-helmet';
15+
import { Link } from 'react-router-dom';
16+
1617
import Editor from '../Sandbox/Editor';
1718
import { BlinkingDot } from './BlinkingDot';
1819

@@ -115,7 +116,7 @@ class LivePage extends React.Component {
115116
);
116117
}
117118

118-
if (store.live.isLoading || !store.editor.currentSandbox) {
119+
if (!store.editor.currentSandbox) {
119120
return (
120121
<>
121122
<Skeleton

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ class SandboxPage extends React.Component {
117117
return <NotFound />;
118118
}
119119

120-
if (
121-
store.editor.isLoading ||
122-
(store.live.isTeam && store.live.isLoading) ||
123-
store.editor.currentSandbox == null
124-
) {
120+
if (store.editor.isLoading || !store.editor.currentSandbox) {
125121
return (
126122
<>
127123
<Skeleton

0 commit comments

Comments
 (0)