pwa debug
This commit is contained in:
@@ -18,28 +18,30 @@ export class AppComponent {
|
||||
) {
|
||||
|
||||
console.log('Start versionUpdates subscribe', this._swUpdate.isEnabled, environment.production);
|
||||
this._swUpdate.versionUpdates.subscribe((evt) => {
|
||||
console.log('Version update', evt);
|
||||
if (evt.type === 'VERSION_READY') {
|
||||
console.log('tt');
|
||||
this._swUpdate.activateUpdate().then(() => {
|
||||
console.log('Update!');
|
||||
this._notifications.add({
|
||||
text: "New version available. DiunaBI will restart in 10 seconds.",
|
||||
duration: 10000,
|
||||
dismiss: () => {
|
||||
window.location.reload()
|
||||
},
|
||||
btn: 'Cancel',
|
||||
action: () => {
|
||||
if (this._swUpdate.isEnabled && environment.production) {
|
||||
this._swUpdate.versionUpdates.subscribe((evt) => {
|
||||
console.log('versionUpdates', evt);
|
||||
switch (evt.type) {
|
||||
case 'VERSION_READY':
|
||||
this._swUpdate.activateUpdate().then(() => {
|
||||
this._notifications.add({
|
||||
text: "Restart canceled.",
|
||||
btn: "Hide"
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
text: "New version available. DiunaBI will restart in 10 seconds.",
|
||||
duration: 10000,
|
||||
dismiss: () => {
|
||||
window.location.reload()
|
||||
},
|
||||
btn: 'Cancel',
|
||||
action: () => {
|
||||
this._notifications.add({
|
||||
text: "Restart canceled.",
|
||||
btn: "Hide"
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user