-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2.31.4' into main
- Loading branch information
Showing
20 changed files
with
368 additions
and
233 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,65 @@ | ||
import { register } from 'register-service-worker'; | ||
import { register } from "register-service-worker"; | ||
|
||
// The ready(), registered(), cached(), updatefound() and updated() | ||
// events passes a ServiceWorkerRegistration instance in their arguments. | ||
// ServiceWorkerRegistration: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration | ||
|
||
register(process.env.SERVICE_WORKER_FILE, { | ||
// The registrationOptions object will be passed as the second argument | ||
// to ServiceWorkerContainer.register() | ||
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#Parameter | ||
|
||
// registrationOptions: { scope: './' }, | ||
|
||
ready (/* registration */) { | ||
// console.log('Service worker is active.') | ||
}, | ||
|
||
registered (/* registration */) { | ||
// console.log('Service worker has been registered.') | ||
}, | ||
|
||
cached (/* registration */) { | ||
// console.log('Content has been cached for offline use.') | ||
}, | ||
|
||
updatefound (/* registration */) { | ||
// console.log('New content is downloading.') | ||
}, | ||
|
||
updated (registration) { | ||
// Cleares old cash so new content is downloaded | ||
caches.keys().then(function(names) { | ||
for (let name of names) { | ||
console.log("SW Updated. Delete cache", name) | ||
caches.delete(name); | ||
} | ||
}); | ||
|
||
// Nofitify the user and let them download the new content | ||
// Notify.create({ | ||
// message: "New content available.", | ||
// type: "info", | ||
// icon: "fas fa-arrow-alt-to-bottom", | ||
// color: "neutral-7", | ||
// iconSize: "15px", | ||
// position: "top", | ||
// timeout: 0, | ||
// actions: [ | ||
// { label: 'Fetch', color: 'white', noCaps: true, size: "md", handler: () => { registration.waiting.postMessage({ type: "SKIP_WAITING" }); } }, | ||
// ] | ||
// }); | ||
}, | ||
|
||
offline () { | ||
// console.log('No internet connection found. App is running in offline mode.') | ||
}, | ||
|
||
error (/* err */) { | ||
// console.error('Error during service worker registration:', err) | ||
} | ||
}); | ||
// The registrationOptions object will be passed as the second argument | ||
// to ServiceWorkerContainer.register() | ||
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#Parameter | ||
|
||
// registrationOptions: { scope: './' }, | ||
|
||
ready(/* registration */) { | ||
// console.log('Service worker is active.') | ||
}, | ||
|
||
registered(/* registration */) { | ||
// console.log('Service worker has been registered.') | ||
}, | ||
|
||
cached(/* registration */) { | ||
// console.log('Content has been cached for offline use.') | ||
}, | ||
|
||
updatefound(registration) { | ||
try { | ||
registration.update(); | ||
} catch (err) { | ||
console.err("SW update failed:", err); | ||
} | ||
}, | ||
|
||
updated(registration) { | ||
// Cleares old cash so new content is downloaded | ||
caches.keys().then(function (names) { | ||
for (let name of names) { | ||
console.log("SW Updated. Delete cache", name); | ||
caches.delete(name); | ||
} | ||
}); | ||
|
||
// Nofitify the user and let them download the new content | ||
// Notify.create({ | ||
// message: "New content available.", | ||
// type: "info", | ||
// icon: "fas fa-arrow-alt-to-bottom", | ||
// color: "neutral-7", | ||
// iconSize: "15px", | ||
// position: "top", | ||
// timeout: 0, | ||
// actions: [ | ||
// { label: 'Fetch', color: 'white', noCaps: true, size: "md", handler: () => { registration.waiting.postMessage({ type: "SKIP_WAITING" }); } }, | ||
// ] | ||
// }); | ||
}, | ||
|
||
offline() { | ||
// console.log('No internet connection found. App is running in offline mode.') | ||
}, | ||
|
||
error(/* err */) { | ||
// console.error('Error during service worker registration:', err) | ||
}, | ||
}); |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.