From 7c8a700187c3d0527697d4f7914b3e0f766f57b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 6 Jun 2024 16:46:51 +0200 Subject: [PATCH] Webapp: only emit 'activeJobDeleted' event when the active job was deleted Only emit the `activeJobDeleted` event when the active job was deleted. Previously this was emitted on _any_ job deletion, which would make working with the web interface quite confusing when mass deletion was happening, as it would always deselect the job, even when showing an unrelated job. --- web/app/src/components/jobs/JobsTable.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/app/src/components/jobs/JobsTable.vue b/web/app/src/components/jobs/JobsTable.vue index a1dea954..1e13b3b2 100644 --- a/web/app/src/components/jobs/JobsTable.vue +++ b/web/app/src/components/jobs/JobsTable.vue @@ -28,7 +28,7 @@ import StatusFilterBar from '@/components/StatusFilterBar.vue'; export default { name: 'JobsTable', props: ['activeJobID'], - emits: ['tableRowClicked', 'activeJobDeleted'], + emits: ['tableRowClicked', 'activeJobDeleted', 'jobDeleted'], components: { JobActionsBar, StatusFilterBar, @@ -166,7 +166,10 @@ export default { if (row) promise = row.delete(); else promise = Promise.resolve(); promise.finally(() => { - this.$emit('activeJobDeleted', jobUpdate.id); + this.$emit('jobDeleted', jobUpdate.id); + if (jobUpdate.id == this.activeJobID) { + this.$emit('activeJobDeleted', jobUpdate.id); + } }); } else { if (row) promise = this.tabulator.updateData([jobUpdate]);