Skip to content

Commit

Permalink
Clear transient move timeout on round leave
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Dec 20, 2020
1 parent f4242b8 commit 0e6969d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/ui/shared/round/OnlineRound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ export default class OnlineRound implements OnlineRoundInterface {
}

public unload() {
this.transientMove.clear()
if (this.clock) this.clock.unload()
clearInterval(this.clockIntervId)
this.appStateListener.remove()
Expand Down
4 changes: 2 additions & 2 deletions src/ui/shared/round/TransientMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import OnlineRound from './OnlineRound'
*/
export default class TransientMove {

private current: number | undefined = undefined
private current?: number

constructor(readonly ctrl: OnlineRound) { }

Expand All @@ -20,7 +20,7 @@ export default class TransientMove {
}

clear = () => {
if (this.current) clearTimeout(this.current)
clearTimeout(this.current)
}

expire = () => {
Expand Down

0 comments on commit 0e6969d

Please sign in to comment.