Skip to content

Commit 6da993c

Browse files
committed
Fix issue on Timer where setDuration would restart a paused timer
1 parent 0653099 commit 6da993c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/uui-base/lib/utils/Timer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export class Timer {
1010

1111
public setDuration(duration: number) {
1212
this._duration = duration;
13-
this.restart();
13+
// TODO: Should calculate true offset of _remaining
14+
if (this._timerId !== null) {
15+
this.restart();
16+
}
1417
}
1518

1619
/** starts the timer */

0 commit comments

Comments
 (0)