From ad04856a0236dda7effbeac6e4c4b7abb3b580d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 3 May 2022 16:29:14 +0200 Subject: [PATCH] Web: only use the tasks table if it exists Because of the `v-if` attribute, `this.$refs.tasksTable` may actually be `null` if there are no tasks shown. --- web/app/src/App.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/web/app/src/App.vue b/web/app/src/App.vue index d4592ea9..ae65f89d 100644 --- a/web/app/src/App.vue +++ b/web/app/src/App.vue @@ -132,14 +132,10 @@ export default { * @param {API.SocketIOTaskUpdate} taskUpdate */ onSioTaskUpdate(taskUpdate) { - if (!this.$refs.tasksTable) { - return; - } - - this.$refs.tasksTable.processTaskUpdate(taskUpdate); - if (this.tasks.activeTaskID == taskUpdate.id) { + if (this.$refs.tasksTable) + this.$refs.tasksTable.processTaskUpdate(taskUpdate); + if (this.tasks.activeTaskID == taskUpdate.id) this.onSelectedTaskChanged(taskUpdate); - } }, onChatMessage(message) { @@ -150,7 +146,8 @@ export default { // SocketIO connection event handlers: onSIOReconnected() { this.$refs.jobsTable.onReconnected(); - this.$refs.tasksTable.onReconnected(); + if (this.$refs.tasksTable) + this.$refs.tasksTable.onReconnected(); this.fetchManagerInfo(); }, onSIODisconnected(reason) {