Skip to content

Commit dd88cc4

Browse files
committed
Discard deprecated electron handlers
1 parent 1c939df commit dd88cc4

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

src/cloud/components/App.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
1-
import React, { useState } from 'react'
1+
import React from 'react'
22
import Router from './Router'
33
import {
4-
initAccessToken,
54
usingElectron,
65
sendToHost,
76
useElectron,
87
globalContextMenuIsConfigured,
9-
getCurrentDesktopAppVersion,
108
} from '../lib/stores/electron'
119
import { GlobalDataProvider } from '../lib/stores/globalData'
1210
import { useEffectOnce } from 'react-use'
1311
import { gaTrackingId, nodeEnv, boostHubBaseUrl } from '../lib/consts'
1412
import '../lib/i18n'
15-
import ltSemver from 'semver/functions/lt'
1613

1714
import { RealtimeConnProvider } from '../lib/stores/realtimeConn'
1815
import { V2ToastProvider } from '../../design/lib/stores/toast'
1916
const App = () => {
2017
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-
})
3418

3519
useEffectOnce(() => {
3620
if (!usingElectron) {
@@ -51,10 +35,6 @@ const App = () => {
5135
}
5236
})
5337

54-
if (usingElectron && !accessTokenInitialized) {
55-
return <div>Fetching access token...</div>
56-
}
57-
5838
return (
5939
<>
6040
<link href='/app/katex/katex.min.css' rel='stylesheet' />

src/cloud/lib/stores/electron.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,6 @@ const useElectronStore = (): ElectronStore => {
210210
})
211211
}
212212
)
213-
/**
214-
* TODO: Should be discarded after v0.23
215-
*/
216-
addHostListener(
217-
'update-access-token',
218-
(_event: IpcRendererEvent, accessToken: string | null) => {
219-
if (!accessTokenHasBeenInitialized) {
220-
accessTokenHasBeenInitialized = true
221-
}
222-
setAccessToken(accessToken)
223-
}
224-
)
225213

226214
addHostListener(
227215
'switch-space',

0 commit comments

Comments
 (0)