diff options
Diffstat (limited to 'subprojects/frontend/src/utils/PendingTask.ts')
-rw-r--r-- | subprojects/frontend/src/utils/PendingTask.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/subprojects/frontend/src/utils/PendingTask.ts b/subprojects/frontend/src/utils/PendingTask.ts index 086993d4..3976bdf9 100644 --- a/subprojects/frontend/src/utils/PendingTask.ts +++ b/subprojects/frontend/src/utils/PendingTask.ts | |||
@@ -9,13 +9,13 @@ export default class PendingTask<T> { | |||
9 | 9 | ||
10 | private resolved = false; | 10 | private resolved = false; |
11 | 11 | ||
12 | private timeout: number | null; | 12 | private timeout: number | undefined; |
13 | 13 | ||
14 | constructor( | 14 | constructor( |
15 | resolveCallback: (value: T) => void, | 15 | resolveCallback: (value: T) => void, |
16 | rejectCallback: (reason?: unknown) => void, | 16 | rejectCallback: (reason?: unknown) => void, |
17 | timeoutMs?: number, | 17 | timeoutMs?: number | undefined, |
18 | timeoutCallback?: () => void, | 18 | timeoutCallback?: () => void | undefined, |
19 | ) { | 19 | ) { |
20 | this.resolveCallback = resolveCallback; | 20 | this.resolveCallback = resolveCallback; |
21 | this.rejectCallback = rejectCallback; | 21 | this.rejectCallback = rejectCallback; |
@@ -28,8 +28,6 @@ export default class PendingTask<T> { | |||
28 | } | 28 | } |
29 | } | 29 | } |
30 | }, timeoutMs); | 30 | }, timeoutMs); |
31 | } else { | ||
32 | this.timeout = null; | ||
33 | } | 31 | } |
34 | } | 32 | } |
35 | 33 | ||
@@ -53,8 +51,9 @@ export default class PendingTask<T> { | |||
53 | 51 | ||
54 | private markResolved() { | 52 | private markResolved() { |
55 | this.resolved = true; | 53 | this.resolved = true; |
56 | if (this.timeout !== null) { | 54 | if (this.timeout !== undefined) { |
57 | clearTimeout(this.timeout); | 55 | clearTimeout(this.timeout); |
56 | this.timeout = undefined; | ||
58 | } | 57 | } |
59 | } | 58 | } |
60 | } | 59 | } |