Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
grzpab committed Dec 7, 2023
1 parent d7b2455 commit 09fb065
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/data/readHomeDirectoryCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export class HomeDirectoryService {

const caseEventEmitter = this._createEventEmitter(path);

this._caseEventEmitters.set(path, caseEventEmitter);

caseEventEmitter.once('finish', () => {
this._caseEventEmitters.delete(path);
});
Expand All @@ -81,8 +83,6 @@ export class HomeDirectoryService {

this._caseEventEmitters.delete(path);
});

this._caseEventEmitters.set(path, caseEventEmitter);
}
} catch (error) {
console.error(error);
Expand All @@ -109,6 +109,16 @@ export class HomeDirectoryService {
const caseEventEmitter = this._createEventEmitter(path);

this._caseEventEmitters.set(path, caseEventEmitter);

caseEventEmitter.once('finish', () => {
this._caseEventEmitters.delete(path);
});

caseEventEmitter.once('error', (error) => {
console.error(error);

this._caseEventEmitters.delete(path);
});
}

protected _createEventEmitter(path: string): CaseEventEmitter {
Expand Down

0 comments on commit 09fb065

Please sign in to comment.