Skip to content

Commit

Permalink
Fix logging not to log "Loaded 0 files out of 0 files." which happens…
Browse files Browse the repository at this point in the history
… when the application is still collecting files to load from the opened folder and has not started loading files yet.
  • Loading branch information
TomoyukiAota committed Dec 3, 2024
1 parent d6bd864 commit 863f20a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class LoadingFolderProgressReporterService {
public progressStatus = new Subject<LoadingFolderProgressStatus>();

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;
Expand All @@ -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,
Expand Down

0 comments on commit 863f20a

Please sign in to comment.