fix check for update button not showing

this happened when the app starts when it is already up to date
This commit is contained in:
David Lechner
2021-01-28 20:37:51 -06:00
parent 252c741180
commit 8b3606c397
+7
View File
@@ -63,6 +63,13 @@ function registerValidSW(swUrl: string, config?: Config): void {
navigator.serviceWorker
.register(swUrl)
.then((registration) => {
if (registration.active) {
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {