From 863f20a0bf1e56d8d38c0f0af9a40de5a452bd25 Mon Sep 17 00:00:00 2001 From: Tomoyuki Aota Date: Wed, 4 Dec 2024 02:41:51 +0900 Subject: [PATCH] Fix logging not to log "Loaded 0 files out of 0 files." which happens when the application is still collecting files to load from the opened folder and has not started loading files yet. --- .../loading-folder-progress-reporter.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/loading-folder/progress-reporter/loading-folder-progress-reporter.service.ts b/src/app/loading-folder/progress-reporter/loading-folder-progress-reporter.service.ts index 6afb4362..b8a816df 100644 --- a/src/app/loading-folder/progress-reporter/loading-folder-progress-reporter.service.ts +++ b/src/app/loading-folder/progress-reporter/loading-folder-progress-reporter.service.ts @@ -19,6 +19,7 @@ export class LoadingFolderProgressReporterService { public progressStatus = new Subject(); public startUpdatingProgress(): void { + Logger.info('[Loading Folder] Collecting files to load from the opened folder...'); const updateMilliseconds = 100; const intervalId = setInterval(() => { const numberOfLoadedFiles = progress.numberOfLoadedFiles; @@ -27,7 +28,11 @@ export class LoadingFolderProgressReporterService { const isStarted = progress.isStarted; const isInProgress = progress.isInProgress; const isCompleted = progress.isCompleted; - Logger.info(`[Loading Folder] Loaded ${numberOfLoadedFiles} files out of ${numberOfAllFilesToLoad} files.`); + + if (isStarted) { + Logger.info(`[Loading Folder] Loaded ${numberOfLoadedFiles} files out of ${numberOfAllFilesToLoad} files.`); + } + this.progressStatus.next({ numberOfLoadedFiles, numberOfAllFilesToLoad,