diff --git a/web-app/src/routes/settings/general.tsx b/web-app/src/routes/settings/general.tsx
index 4fc441e21..3aeb0c3b9 100644
--- a/web-app/src/routes/settings/general.tsx
+++ b/web-app/src/routes/settings/general.tsx
@@ -8,6 +8,7 @@ import { Card, CardItem } from '@/containers/Card'
import LanguageSwitcher from '@/containers/LanguageSwitcher'
import { useTranslation } from 'react-i18next'
import { useGeneralSetting } from '@/hooks/useGeneralSetting'
+import { useAppUpdater } from '@/hooks/useAppUpdater'
import { useEffect, useState } from 'react'
import { open } from '@tauri-apps/plugin-dialog'
import { revealItemInDir } from '@tauri-apps/plugin-opener'
@@ -59,10 +60,12 @@ const openFileTitle = (): string => {
function General() {
const { t } = useTranslation()
const { spellCheckChatInput, setSpellCheckChatInput } = useGeneralSetting()
+ const { checkForUpdate } = useAppUpdater()
const [janDataFolder, setJanDataFolder] = useState
()
const [isCopied, setIsCopied] = useState(false)
const [selectedNewPath, setSelectedNewPath] = useState(null)
const [isDialogOpen, setIsDialogOpen] = useState(false)
+ const [isCheckingUpdate, setIsCheckingUpdate] = useState(false)
useEffect(() => {
const fetchDataFolder = async () => {
@@ -161,6 +164,22 @@ function General() {
}
}
+ const handleCheckForUpdate = async () => {
+ setIsCheckingUpdate(true)
+ try {
+ const update = await checkForUpdate()
+ if (!update) {
+ toast.success('You are using the latest version of Jan!')
+ }
+ // If update is available, the AppUpdater dialog will automatically show
+ } catch (error) {
+ console.error('Failed to check for updates:', error)
+ toast.error('Failed to check for updates. Please try again later.')
+ } finally {
+ setIsCheckingUpdate(false)
+ }
+ }
+
return (
@@ -175,7 +194,26 @@ function General() {
v{VERSION}
+
+ v{VERSION}
+
+ }
+ />
+
+
+ {isCheckingUpdate ? 'Checking...' : 'Check for Updates'}
+
+
}
/>