Files
chad/client/app/middleware/00.updater.global.ts
opti1337 76f0ec74b5
Some checks failed
Deploy / deploy (push) Has been cancelled
Deploy / publish-web (push) Successful in 1m43s
Deploy / publish-tauri (push) Has been cancelled
test publish
2025-12-22 19:23:06 +06:00

21 lines
369 B
TypeScript

export default defineNuxtRouteMiddleware(async (to, from) => {
if (import.meta.dev || import.meta.server)
return
const { isTauri } = useApp()
if (!isTauri.value)
return
if (from?.name)
return
const { checkForUpdates } = useUpdater()
const update = await checkForUpdates()
if (update) {
return navigateTo({ name: 'Updating' })
}
})