mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix invalid state error in PWAUpdatePrompt
This commit is contained in:
1 file changed
+8
-2
@@ -19,8 +19,14 @@ export function PWAUpdatePrompt() {
|
||||
|
||||
// Check for updates periodically (every hour)
|
||||
if (registration) {
|
||||
setInterval(() => {
|
||||
registration.update();
|
||||
const intervalId = setInterval(async () => {
|
||||
try {
|
||||
await registration.update();
|
||||
} catch (error) {
|
||||
// Registration may no longer be valid, clear the interval
|
||||
console.warn('[PWA] Failed to check for updates:', error);
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
}, 60 * 60 * 1000);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user