|
@@ -186,11 +186,18 @@ export default {
|
|
|
// fetch("/models/tiny_face_detector_model-shard1");
|
|
|
// fetch("/models/face_landmark_68_model-shard1");
|
|
|
|
|
|
- this.checkNewVersionInterval = setInterval(() => {
|
|
|
- if (window.__newSWAvailable) {
|
|
|
+ // this.checkNewVersionInterval = setInterval(() => {
|
|
|
+ // if (window.__newSWAvailable) {
|
|
|
+ // this.newVersionAvailable = true;
|
|
|
+ // }
|
|
|
+ // }, 1000);
|
|
|
+ this.checkNewVersionListener = document.addEventListener(
|
|
|
+ "__newSWAvailable",
|
|
|
+ () => {
|
|
|
this.newVersionAvailable = true;
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
+ },
|
|
|
+ { once: true }
|
|
|
+ );
|
|
|
if (this.isEPCC) {
|
|
|
const redirectUrl = new URLSearchParams(location.search).get(
|
|
|
"redirectUrl"
|
|
@@ -271,7 +278,8 @@ export default {
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearTimeout(this.loginTimeout);
|
|
|
- clearInterval(this.checkNewVersionInterval);
|
|
|
+ // clearInterval(this.checkNewVersionInterval);
|
|
|
+ document.removeEventListener(this.checkNewVersionListener);
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(["updateUser", "updateTimeDifference", "updateQECSConfig"]),
|