fix: auto-reload in unsecure contexts (#1532)

This commit is contained in:
Rémi Marseault 2024-02-21 09:11:57 +01:00 committed by GitHub
parent e92d3051e8
commit e8c5e04161
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,10 +61,12 @@ const saveSettings = async () => {
await preferenceStore.fetchPreferences()
if (!preferenceStore.preferences!.alternative_webui_enabled) {
if ("serviceWorker" in navigator) {
const registrations = await navigator.serviceWorker.getRegistrations()
for (const registration of registrations) {
await registration.unregister()
}
}
location.hash = ''
location.reload()
} else {