Skip to content

Commit 74055b0

Browse files
committed
Do update check
1 parent 7206be9 commit 74055b0

File tree

2 files changed

+11
-19
lines changed
  • packages/app/src/app

2 files changed

+11
-19
lines changed

packages/app/src/app/pages/common/Modals/LiveSessionVersionMismatch/index.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
import React from 'react';
22
import { inject } from 'mobx-react';
33

4-
import VERSION, { getTimestamp } from 'common/version';
5-
64
import { Container, Heading, Explanation } from '../elements';
75

8-
function LiveVersionMismatch({ store }) {
9-
const newer =
10-
getTimestamp(store.live.roomInfo.version) > getTimestamp(VERSION);
11-
6+
function LiveVersionMismatch() {
127
return (
138
<Container>
149
<Heading>Version Mismatch</Heading>
1510
<Explanation>
16-
The owner of this session has a{newer ? ' newer' : 'n older'} version of
17-
CodeSandbox.
18-
{newer
19-
? ' Refresh to get the latest version.'
20-
: ' Ask the owner to refresh to get the latest version.'}
11+
You are running an older version of CodeSandbox. Refresh to get the
12+
latest version.
2113
<p>
22-
If refreshing doesn{"'"}t work, you can try to clear your storage and
23-
unregister the service worker.
14+
If refreshing doesn
15+
{"'"}t work, you can try to clear your storage and unregister the
16+
service worker.
2417
</p>
2518
</Explanation>
2619
</Container>

packages/app/src/app/store/modules/live/sequences.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ import { initializeLive as commonInitializeLive } from './common-sequences';
1313
export const initializeLive = [
1414
commonInitializeLive,
1515

16-
// TODO: Add version back
17-
// when(state`live.roomInfo.version`, v => v !== VERSION),
18-
// {
19-
// true: [set(props`modal`, 'liveVersionMismatch'), openModal],
20-
// false: [],
21-
// },
16+
when(state`updateStatus`, s => s === 'available'),
17+
{
18+
true: [set(props`modal`, 'liveVersionMismatch'), openModal],
19+
false: [],
20+
},
2221

2322
setSandbox,
2423
set(state`live.isLoading`, false),

0 commit comments

Comments
 (0)