Skip to content

Commit 4318451

Browse files
committed
fixup! Implement versionCheck
1 parent 76670fa commit 4318451

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/versionCheck.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { config } from '../theme/appConfig'
1010
import { infoServerData } from './network'
1111

1212
const compareVersions = (v1: string, v2: string): number => {
13-
const v1Parts = v1.split('.').map(Number)
14-
const v2Parts = v2.split('.').map(Number)
13+
const v1Parts = v1.split('-')[0].split('.').map(Number)
14+
const v2Parts = v2.split('-')[0].split('.').map(Number)
1515

1616
for (let i = 0; i < 3; i++) {
1717
if (v1Parts[i] > v2Parts[i]) return 1
@@ -26,7 +26,7 @@ export const checkAppVersion = async (): Promise<void> => {
2626

2727
// Get latest version from info server
2828
const updateInfo = infoServerData.rollup?.updateInfo
29-
if (updateInfo == null) return
29+
if (updateInfo == null || updateInfo[platform] == null) return
3030
const { updateVersion, localeMessage } = updateInfo[platform]
3131

3232
const message = getLocaleOrDefaultString(localeMessage)

0 commit comments

Comments
 (0)