@@ -49,7 +49,7 @@ import Locale, {
49
49
changeLang ,
50
50
getLang ,
51
51
} from "../locales" ;
52
- import { copyToClipboard } from "../utils" ;
52
+ import { copyToClipboard , clientUpdate , semverCompare } from "../utils" ;
53
53
import Link from "next/link" ;
54
54
import {
55
55
Anthropic ,
@@ -585,7 +585,7 @@ export function Settings() {
585
585
const [ checkingUpdate , setCheckingUpdate ] = useState ( false ) ;
586
586
const currentVersion = updateStore . formatVersion ( updateStore . version ) ;
587
587
const remoteId = updateStore . formatVersion ( updateStore . remoteVersion ) ;
588
- const hasNewVersion = currentVersion !== remoteId ;
588
+ const hasNewVersion = semverCompare ( currentVersion , remoteId ) === - 1 ;
589
589
const updateUrl = getClientConfig ( ) ?. isApp ? RELEASE_URL : UPDATE_URL ;
590
590
591
591
function checkUpdate ( force = false ) {
@@ -1357,9 +1357,17 @@ export function Settings() {
1357
1357
{ checkingUpdate ? (
1358
1358
< LoadingIcon />
1359
1359
) : hasNewVersion ? (
1360
- < Link href = { updateUrl } target = "_blank" className = "link" >
1361
- { Locale . Settings . Update . GoToUpdate }
1362
- </ Link >
1360
+ clientConfig ?. isApp ? (
1361
+ < IconButton
1362
+ icon = { < ResetIcon > </ ResetIcon > }
1363
+ text = { Locale . Settings . Update . GoToUpdate }
1364
+ onClick = { ( ) => clientUpdate ( ) }
1365
+ />
1366
+ ) : (
1367
+ < Link href = { updateUrl } target = "_blank" className = "link" >
1368
+ { Locale . Settings . Update . GoToUpdate }
1369
+ </ Link >
1370
+ )
1363
1371
) : (
1364
1372
< IconButton
1365
1373
icon = { < ResetIcon > </ ResetIcon > }
0 commit comments