Skip to content
Snippets Groups Projects
Commit d3ac86c2 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

check if automated test before displaying update alert

parent 78956510
No related branches found
No related tags found
2 merge requests!424version 3.1.0,!382REDMINE_ISSUE-13600
......@@ -26,15 +26,19 @@ if (process.env.NODE_ENV === 'production') {
console.log('New content is downloading.');
},
updated (registration) {
alert('Une nouvelle version de l\'application est disponible, l\'application va se recharger');
console.log('New content is available; please refresh.');
//
if (!registration || !registration.waiting) {
return;
if (!navigator.webdriver) {
alert('Une nouvelle version de l\'application est disponible, l\'application va se recharger');
console.log('New content is available; please refresh.');
//
if (!registration || !registration.waiting) {
return;
}
// Send message to SW to skip the waiting and activate the new SW
registration.waiting.postMessage({ type: 'SKIP_WAITING' });
//window.location.reload(true);
} else {
console.log('Execution dans un navigateur controlé par un agent automatisé, la mise à jour n\'est pas appliqué pendant le test.');
}
// Send message to SW to skip the waiting and activate the new SW
registration.waiting.postMessage({ type: 'SKIP_WAITING' });
//window.location.reload(true);
},
offline () {
console.log('No internet connection found. App is running in offline mode.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment