From 1ae42618493ed81792262d7f62745755b0cd335e Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Tue, 14 Dec 2021 21:16:47 -0800 Subject: [PATCH] Added hang timer --- resources/cider-ui-tests/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js index 45608f75..5537ba3c 100644 --- a/resources/cider-ui-tests/index.js +++ b/resources/cider-ui-tests/index.js @@ -167,7 +167,8 @@ const app = new Vue({ currentSongInfo: {}, page: "browse", pageHistory: [], - songstest: false + songstest: false, + hangtimer: null }, watch: { page: () => { @@ -183,6 +184,7 @@ const app = new Vue({ methods: { async init() { let self = this + clearTimeout(this.hangtimer) this.mk = MusicKit.getInstance() this.mk.authorize() this.$forceUpdate() @@ -1679,6 +1681,13 @@ const app = new Vue({ } }) +// Hang Timer +app.hangtimer = setTimeout(()=>{ + if(confirm("Cider is not responding. Reload the app?")) { + window.location.reload() + } +}, 10000) + document.addEventListener('musickitloaded', function () { // MusicKit global is now defined function initMusicKit() {