diff --git a/src/renderer/src/pages/About.tsx b/src/renderer/src/pages/About.tsx index 149c04c..0593a20 100644 --- a/src/renderer/src/pages/About.tsx +++ b/src/renderer/src/pages/About.tsx @@ -42,6 +42,7 @@ export function About() { const { t } = useTranslation() const [settings, _setSettings] = useAtom(settingsAtom) const [updateReady] = useAtom(updateReadyAtom) + const [updateAvailableState] = useAtom(updateAvailableAtom) const setUpdateAvailable = useSetAtom(updateAvailableAtom) const [appVersion, setAppVersion] = useState('—') const [latestVersionState, setLatestVersionState] = useState(null) @@ -70,6 +71,17 @@ export function About() { } }, []) + useEffect(() => { + if (!updateAvailableState.available) { + return + } + + setLatestVersionState({ + status: 'available', + version: updateAvailableState.version ?? '' + }) + }, [updateAvailableState.available, updateAvailableState.version]) + // Listen for update events only in About page useEffect(() => { if (!window?.api) { @@ -264,6 +276,8 @@ export function About() { ? 'text-destructive' : 'text-muted-foreground' const latestVersionStatusText = latestVersionStatusKey ? t(latestVersionStatusKey) : null + const shouldShowCheckUpdates = + !updateAvailableState.available && latestVersionState?.status !== 'available' const handleXFeedback = useCallback(() => { const versionText = appVersion !== '—' ? ` VidBee v${appVersion}` : ' VidBee' @@ -379,10 +393,12 @@ export function About() { {t('about.actions.goToDownload')} ) : null} - + {shouldShowCheckUpdates ? ( + + ) : null}

{t('about.description')}