feat: initial commit

This commit is contained in:
s.esmaeili
2026-09-09 06:46:27 +03:30
commit 0ed6bed028
214 changed files with 20177 additions and 0 deletions
@@ -0,0 +1,17 @@
// Ported from legacy henza_pwa/src/Mixins/useRefresh.ts.
// Auto-applies a waiting service worker as soon as one is available, so the
// PWA self-updates instead of serving a stale precache indefinitely.
import { unref, watchEffect } from 'vue'
import { useRegisterSW } from 'virtual:pwa-register/vue'
export function useRefresh() {
const { offlineReady, needRefresh, updateServiceWorker } = useRegisterSW()
const refreshApp = async () => {
await updateServiceWorker()
offlineReady.value = false
needRefresh.value = false
}
watchEffect(async () => (unref(offlineReady) || unref(needRefresh)) && (await refreshApp()))
}