Răsfoiți Sursa

fix: getting the playback status of the device is not actively triggered

Casper Dai 3 ani în urmă
părinte
comite
b85b9675dc

+ 8 - 3
src/views/device/detail/components/DeviceRuntime/Running.vue

@@ -45,11 +45,16 @@ export default {
       status: ''
     }
   },
+  watch: {
+    online (val) {
+      if (val) {
+        this.ask()
+      }
+    }
+  },
   created () {
     addListener('status', this.onUpdate)
-  },
-  activated () {
-    if (this.online && !this.asking) {
+    if (this.online) {
       this.ask()
     }
   },

+ 0 - 3
src/views/device/detail/components/DeviceRuntime/ScreenShot.vue

@@ -40,9 +40,6 @@ export default {
   created () {
     ScreenshotCache.watch(this.device, this.onScreenshotUpdate, 10000)
   },
-  activated () {
-    ScreenshotCache.watch(this.device, this.onScreenshotUpdate, 10000)
-  },
   beforeDestroy () {
     ScreenshotCache.unwatch(this.device.id)
   },