瀏覽代碼

fix(upgrade): invalid mqtt listener

daigang 2 年之前
父節點
當前提交
cb457bd31b
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/views/platform/upgrade/deploy/components/UpgradeProgress.vue

+ 2 - 2
src/views/platform/upgrade/deploy/components/UpgradeProgress.vue

@@ -49,11 +49,11 @@ export default {
     this.$timer = -1
   },
   mounted () {
-    subscribe([`+/${this.deviceId}/apk/upgrade/progress`], this.onMessage)
+    this.status === 1 && subscribe([`+/${this.deviceId}/apk/upgrade/progress`], this.onMessage)
   },
   beforeDestroy () {
     clearTimeout(this.$timer)
-    unsubscribe([`+/${this.deviceId}/apk/upgrade/progress`], this.onMessage)
+    this.status === 1 && unsubscribe([`+/${this.deviceId}/apk/upgrade/progress`], this.onMessage)
   },
   methods: {
     onMessage (topic, message) {