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