diff --git a/app/src/App.vue b/app/src/App.vue
index 6d06c2d..9993820 100644
--- a/app/src/App.vue
+++ b/app/src/App.vue
@@ -116,11 +116,18 @@
methods: {
autoReloadStats () {
apiDevice.getStats(stats => {
+ // give esp some extra time befor fetch new data
+ stats.playlist.remaining += 2
+
+ // reset old so reactive watcher can detect a change
+ if (this.$root._data.stats) {
+ this.$root._data.stats.playlist.remaining = 0
+ }
this.$root._data.stats = stats
setTimeout(() => {
this.autoReloadStats()
- }, (stats.playlist.remaining + 2) * 1000)
+ }, stats.playlist.remaining * 1000)
})
}
}
diff --git a/app/src/components/ScreenCard.vue b/app/src/components/ScreenCard.vue
index e4d0aad..94f3dca 100644
--- a/app/src/components/ScreenCard.vue
+++ b/app/src/components/ScreenCard.vue
@@ -32,23 +32,23 @@
-
-
+
+ -->
-
- $settings
-
+
+ $settings
+
{
+ if (this.playlistRemainingCountdown > 0) {
+ this.playlistRemainingCountdown--;
+ }
+ }, 1000);
},
computed: {
playlistProgress() {
@@ -84,15 +90,9 @@ export default {
},
watch: {
playlistRemaining(val) {
- this.playlistRemainingCountdown = val;
- this.device_screen_src = "/current-image?" + Date.now();
- },
-
- playlistRemainingCountdown(val) {
if (val > 0) {
- setTimeout(() => {
- this.playlistRemainingCountdown--;
- }, 1000);
+ this.playlistRemainingCountdown = val;
+ this.device_screen_src = "/current-image?" + Date.now();
}
}
}