Versioning and Updating improvements
This commit is contained in:
+44
-14
@@ -1088,20 +1088,50 @@ export const SettingsView: Component<{ setView?: (v: string) => void }> = (props
|
||||
</div>
|
||||
|
||||
<footer class="pt-40 pb-20 flex flex-col items-center gap-4">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
class="h-8 gap-2 text-[0.625rem] font-bold uppercase tracking-widest text-muted-foreground hover:text-foreground opacity-30 hover:opacity-100 transition-opacity"
|
||||
onClick={async () => {
|
||||
const { forceServiceWorkerUpdate } = await import('@/components/PwaUpdater');
|
||||
forceServiceWorkerUpdate();
|
||||
toast.success("Checking for updates...");
|
||||
}}
|
||||
>
|
||||
<Upload class="rotate-180" size={14} />
|
||||
Check for Updates
|
||||
</Button>
|
||||
<p class="text-[0.5rem] font-mono text-muted-foreground/30 uppercase tracking-[0.2em]">Tasgrid v1.0.1</p> {/* Versioning System: v[breaking update].[user-facing update].[patch/backend updated] */}
|
||||
<div class="flex items-center gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
class="h-8 gap-2 text-[0.625rem] font-bold uppercase tracking-widest text-muted-foreground hover:text-foreground opacity-70 hover:opacity-100 transition-opacity"
|
||||
onClick={async () => {
|
||||
const { updateAndReloadApp } = await import('@/components/PwaUpdater');
|
||||
toast.success("Updating app...");
|
||||
updateAndReloadApp();
|
||||
}}
|
||||
>
|
||||
<Upload class="rotate-180" size={14} />
|
||||
Update App
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
class="h-8 gap-2 text-[0.625rem] font-bold uppercase tracking-widest text-muted-foreground hover:text-foreground opacity-70 hover:opacity-100 transition-opacity"
|
||||
onClick={async () => {
|
||||
if (!confirm("Reset PWA? This will clear offline data and reload.")) return;
|
||||
try {
|
||||
const registrations = await navigator.serviceWorker?.getRegistrations?.();
|
||||
if (registrations) {
|
||||
await Promise.all(registrations.map(r => r.unregister()));
|
||||
}
|
||||
if ('caches' in window) {
|
||||
const keys = await caches.keys();
|
||||
await Promise.all(keys.map(k => caches.delete(k)));
|
||||
}
|
||||
toast.success("PWA reset. Reloading...");
|
||||
window.location.reload();
|
||||
} catch (err) {
|
||||
console.error("Failed to reset PWA", err);
|
||||
toast.error("Failed to reset PWA");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
Reset PWA
|
||||
</Button>
|
||||
</div>
|
||||
<p class="text-[0.5rem] font-mono text-muted-foreground/60 uppercase tracking-[0.2em]">
|
||||
Tasgrid v{__APP_VERSION__}
|
||||
</p> {/* Versioning System: v[breaking update].[user-facing update].[patch/backend updated] */}
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user