From 013b23fc70c367900c1b874b16fb7df3f3b462e5 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 27 Aug 2023 15:39:18 +0200 Subject: [PATCH] Disable dialog for purge caches & Re-order buttons Signed-off-by: Florian Hotze --- .../org.openhab.ui/web/src/components/app.vue | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/components/app.vue b/bundles/org.openhab.ui/web/src/components/app.vue index 2091430a05..09b3ef6782 100644 --- a/bundles/org.openhab.ui/web/src/components/app.vue +++ b/bundles/org.openhab.ui/web/src/components/app.vue @@ -144,12 +144,12 @@ {{ $t('dialogs.retry') }} - - {{ $t('about.reload.purgeCachesAndRefresh') }} - {{ $t('about.reload.reloadApp') }} + + {{ $t('about.reload.purgeCachesAndRefresh') }} + @@ -712,35 +712,30 @@ export default { return toast }, purgeServiceWorkerAndCaches () { - this.$f7.dialog.confirm( - this.$t('about.reload.confirmPurge'), - () => { - navigator.serviceWorker.getRegistrations().then(function (registrations) { - for (let registration of registrations) { - registration.unregister().then(function () { - return self.clients.matchAll() - }).then(function (clients) { - clients.forEach(client => { - if (client.url && 'navigate' in client) { - setTimeout(() => { client.navigate(client.url.split('#')[0]) }, 1000) - } - }) - }) - } - }) - window.caches.keys().then(function (cachesNames) { - console.log('Deleting caches') - return Promise.all(cachesNames.map(function (cacheName) { - return caches.delete(cacheName).then(function () { - console.log('Cache with name ' + cacheName + ' is deleted') - }) - })) - }).then(function () { - console.log('Caches deleted') - setTimeout(() => { location.reload(true) }, 1000) + navigator.serviceWorker.getRegistrations().then(function (registrations) { + for (let registration of registrations) { + registration.unregister().then(function () { + return self.clients.matchAll() + }).then(function (clients) { + clients.forEach(client => { + if (client.url && 'navigate' in client) { + setTimeout(() => { client.navigate(client.url.split('#')[0]) }, 1000) + } + }) }) } - ) + }) + window.caches.keys().then(function (cachesNames) { + console.log('Deleting caches') + return Promise.all(cachesNames.map(function (cacheName) { + return caches.delete(cacheName).then(function () { + console.log('Cache with name ' + cacheName + ' is deleted') + }) + })) + }).then(function () { + console.log('Caches deleted') + setTimeout(() => { location.reload(true) }, 1000) + }) }, reload () { document.location.reload()