From 72fd1ac761000e559bbe510fed5afd635125bc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 2 Jun 2022 18:29:16 +0200 Subject: [PATCH] Web: simplify log tail fetching a bit --- web/app/src/components/footer/TaskLog.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/app/src/components/footer/TaskLog.vue b/web/app/src/components/footer/TaskLog.vue index 40ccc099..0bbbfd45 100644 --- a/web/app/src/components/footer/TaskLog.vue +++ b/web/app/src/components/footer/TaskLog.vue @@ -34,10 +34,7 @@ onMounted(() => { tabulator.on("tableBuilt", _subscribeToPinia); console.log("Task log list: mounted on task ID", tasks.activeTaskID); - if (tasks.activeTaskID) - _fetchLogTail(tasks.activeTaskID); - else - taskLog.clear(); + _fetchLogTail(tasks.activeTaskID); }); onUnmounted(() => { taskLog.clear(); @@ -62,6 +59,8 @@ function _subscribeToPinia() { function _fetchLogTail(taskID) { taskLog.clear(); + if (!taskID) return; + const jobsAPI = new API.JobsApi(apiClient); return jobsAPI.fetchTaskLogTail(taskID) .then((logTail) => {