From 8038b0efd4912a7a13ea644c91f3eefbcfe3fcf6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 3 Nov 2024 08:51:44 +0100 Subject: [PATCH] Improved wording for Background Job tracking --- src/composables/backgroundJob.ts | 4 ++-- src/stores/ftbot.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/composables/backgroundJob.ts b/src/composables/backgroundJob.ts index b15e2a96..eaf67048 100644 --- a/src/composables/backgroundJob.ts +++ b/src/composables/backgroundJob.ts @@ -4,7 +4,7 @@ import { AxiosInstance } from 'axios'; const jobs = ref>({}); export function useBackgroundJob() { - function start(api: AxiosInstance, showAlert: any, jobId: string, jobType: string) { + function startBgJob(api: AxiosInstance, showAlert: any, jobId: string, jobType: string) { async function getBackgroundJobStatus(jobId: string) { try { const { data } = await api.get(`/background/${jobId}`); @@ -51,6 +51,6 @@ export function useBackgroundJob() { return { runningJobs, - start, + startBgJob, }; } diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index be3c55e9..b83034fc 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -711,6 +711,8 @@ export function createBotSubStore(botId: string, botName: string) { '/download_data', payload, ); + const { startBgJob } = useBackgroundJob(); + startBgJob(api, showAlert, data.job_id, 'download_data'); return Promise.resolve(data); } catch (error) { console.error(error);