From 8b8a7a0f06c6d5317b8277de96238515784f719d Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 20 Nov 2024 20:13:32 +0100 Subject: [PATCH] chore: improved function naming --- src/composables/backgroundJob.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/composables/backgroundJob.ts b/src/composables/backgroundJob.ts index ef3f405a..f40305b6 100644 --- a/src/composables/backgroundJob.ts +++ b/src/composables/backgroundJob.ts @@ -23,17 +23,17 @@ export function useBackgroundJob() { try { result.value = await getBackgroundJobStatus(jobId); if (!result.value.running) { - clearJobFromList(); + clearJobFromRunningList(); } jobs.value[jobId] = { ...jobs.value[jobId], taskStatus: result.value }; } catch (error) { console.error(error); showAlert('Failed to get background job status', 'error'); - clearJobFromList(); + clearJobFromRunningList(); } }, 500); - function clearJobFromList() { + function clearJobFromRunningList() { if (interval) { clearInterval(interval); } @@ -47,6 +47,7 @@ export function useBackgroundJob() { } const runningJobs = computed(() => jobs.value); + function clearJobs() { // Clear all jobs that are not running for (const [jobId, job] of Object.entries(jobs.value)) {