Skip to content

Commit

Permalink
fix(docs): prompt => confirm (#10431)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtenfys authored and pieh committed Dec 12, 2018
1 parent 37f26c0 commit 7a79955
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docs/add-offline-support-with-a-service-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Note: Service worker registers only in production builds (`gatsby build`).

### Displaying a message when a service worker updates

To display a custom message once your service worker finds an update, you can use the [`onServiceWorkerUpdateFound`](/docs/browser-apis/#onServiceWorkerUpdateFound) browser API in your `gatsby-browser.js` file. The following code will display a prompt asking the user whether they would like to refresh the page when an update is found:
To display a custom message once your service worker finds an update, you can use the [`onServiceWorkerUpdateFound`](/docs/browser-apis/#onServiceWorkerUpdateFound) browser API in your `gatsby-browser.js` file. The following code will display a confirm prompt asking the user whether they would like to refresh the page when an update is found:

```javascript:title=gatsby-browser.js
exports.onServiceWorkerUpdateFound = () => {
const answer = window.prompt(
const answer = window.confirm(
`This application has been updated. ` +
`Reload to display the latest version?`
)
Expand Down

0 comments on commit 7a79955

Please sign in to comment.