Skip to content

Instantly share code, notes, and snippets.

@webmaxru
Created November 4, 2017 15:48
Show Gist options
  • Save webmaxru/b60935d68c30df7ea5958af972a9b9e3 to your computer and use it in GitHub Desktop.
Save webmaxru/b60935d68c30df7ea5958af972a9b9e3 to your computer and use it in GitHub Desktop.
checkForUpdate and activateUpdate methods of SwUpdate
checkForUpdate() {
console.log('[App] checkForUpdate started')
this.swUpdate.checkForUpdate()
.then(() => {
console.log('[App] checkForUpdate completed')
})
.catch(err => {
console.error(err);
})
}
activateUpdate() {
console.log('[App] activateUpdate started')
this.swUpdate.activateUpdate()
.then(() => {
console.log('[App] activateUpdate completed')
this.winRef.nativeWindow.location.reload()
})
.catch(err => {
console.error(err);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment