Skip to content

Commit

Permalink
ServiceWorker update message
Browse files Browse the repository at this point in the history
  • Loading branch information
stebrech committed Jul 26, 2021
1 parent aba69ba commit a53eadd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@ import "./src/styles/reset.css"
import "./src/styles/global.module.css"
import "./src/styles/accessibility.css"
import "./src/styles/general.css"
import { useIntl } from "react-intl"

export const onServiceWorkerUpdateReady = () => {
const answer = window.confirm(
useIntl.formatMessage({ id: "sw.outdated" })
)
if (answer === true) {
window.location.reload()
}
}
3 changes: 2 additions & 1 deletion i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"error.description": "Oh nein, irgendetwas ist schief gegangen. Die aufgerufene Seite scheint nicht zu existieren. Vielleicht wurde sie gelöscht oder verschoben.",
"error.dog": "Traurig aussehnder Hund trägt eine Jeansjacke.",
"github.icon": "Github Logo",
"github.edit": "Diesen Beitrag verbessern"
"github.edit": "Diesen Beitrag verbessern",
"sw.outdated": "Diese Webapp wurde aktualisiert. Willst du neu laden um die neuste Version zu sehen?"
}
3 changes: 2 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"error.description": "Oh no, something went wrong. The requested page doesn't seem to exist. Maybe it has been deleted or moved.",
"error.dog": "Sad looking dog wears a jeans jacket.",
"github.icon": "Github Logo",
"github.edit": "Improve this post"
"github.edit": "Improve this post",
"sw.outdated": "This web app has been updated. Reload to display the latest version?"
}

0 comments on commit a53eadd

Please sign in to comment.