1
- import React , { useState } from 'react'
1
+ import React from 'react'
2
2
import Router from './Router'
3
3
import {
4
- initAccessToken ,
5
4
usingElectron ,
6
5
sendToHost ,
7
6
useElectron ,
8
7
globalContextMenuIsConfigured ,
9
- getCurrentDesktopAppVersion ,
10
8
} from '../lib/stores/electron'
11
9
import { GlobalDataProvider } from '../lib/stores/globalData'
12
10
import { useEffectOnce } from 'react-use'
13
11
import { gaTrackingId , nodeEnv , boostHubBaseUrl } from '../lib/consts'
14
12
import '../lib/i18n'
15
- import ltSemver from 'semver/functions/lt'
16
13
17
14
import { RealtimeConnProvider } from '../lib/stores/realtimeConn'
18
15
import { V2ToastProvider } from '../../design/lib/stores/toast'
19
16
const App = ( ) => {
20
17
useElectron ( )
21
- // TODO: Deprecate after v0.23.0
22
- const [ accessTokenInitialized , setAccessTokenInitialized ] = useState ( false )
23
-
24
- useEffectOnce ( ( ) => {
25
- ; ( async ( ) => {
26
- const currentVersion = getCurrentDesktopAppVersion ( )
27
- if ( currentVersion != null && ltSemver ( currentVersion , '0.23.0' ) ) {
28
- await initAccessToken ( )
29
- }
30
-
31
- setAccessTokenInitialized ( true )
32
- } ) ( )
33
- } )
34
18
35
19
useEffectOnce ( ( ) => {
36
20
if ( ! usingElectron ) {
@@ -51,10 +35,6 @@ const App = () => {
51
35
}
52
36
} )
53
37
54
- if ( usingElectron && ! accessTokenInitialized ) {
55
- return < div > Fetching access token...</ div >
56
- }
57
-
58
38
return (
59
39
< >
60
40
< link href = '/app/katex/katex.min.css' rel = 'stylesheet' />
0 commit comments