From 1335ce1f18c1b85479ed498f11b1d78c85868daa Mon Sep 17 00:00:00 2001 From: Kai Vandivier Date: Fri, 24 Sep 2021 18:00:53 +0200 Subject: [PATCH] fix(offline-interface): improve SW update message & actions --- pwa/i18n/en.pot | 11 +++++++---- pwa/src/offline-interface/offline-interface.js | 14 ++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pwa/i18n/en.pot b/pwa/i18n/en.pot index 33500a68c..e8268e78a 100644 --- a/pwa/i18n/en.pot +++ b/pwa/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2021-06-08T14:38:45.083Z\n" -"PO-Revision-Date: 2021-06-08T14:38:45.083Z\n" +"POT-Creation-Date: 2021-09-24T15:38:52.938Z\n" +"PO-Revision-Date: 2021-09-24T15:38:52.938Z\n" msgid "" "App updates are ready and will be activated after all tabs of this app are " @@ -15,5 +15,8 @@ msgstr "" "App updates are ready and will be activated after all tabs of this app are " "closed. Skip waiting and reload to update now?" -msgid "Update" -msgstr "Update" +msgid "Update and reload" +msgstr "Update and reload" + +msgid "Not now" +msgstr "Not now" diff --git a/pwa/src/offline-interface/offline-interface.js b/pwa/src/offline-interface/offline-interface.js index 0daf626bc..b5c58d5aa 100644 --- a/pwa/src/offline-interface/offline-interface.js +++ b/pwa/src/offline-interface/offline-interface.js @@ -62,17 +62,19 @@ export class OfflineInterface { if (!promptUpdate) { return } - const reloadMessage = i18n.t( - 'App updates are ready and will be activated after all tabs of this app are closed. Skip waiting and reload to update now?' - ) + + const message = i18n.t("There's an update available for this app.") const onConfirm = () => registration.waiting.postMessage({ type: swMsgs.skipWaiting, }) + const actions = [ + { label: i18n.t('Update and reload'), onClick: onConfirm }, + { label: i18n.t('Not now'), onClick: () => {} }, + ] promptUpdate({ - message: reloadMessage, - action: i18n.t('Update'), - onConfirm: onConfirm, + message, + actions, }) }