Skip to content

Commit

Permalink
Merge pull request #268 from computas/SP24-771-Remove-idle-timeout-fr…
Browse files Browse the repository at this point in the history
…om-drawing-board

avoids opening idle timeout box while drawing
  • Loading branch information
TobiasHermansen-Computas authored Sep 18, 2024
2 parents 8985571 + e38ca23 commit e735e3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ export class AppComponent implements OnInit {

//Whenever user become inactive (25sec) -> open prompt.
this.userInactive.subscribe(() => {
//Never open prompt on drawing page.
if (this.gameStateService.getCurrentPage() === GAMESTATE.drawingBoard) {
this.setDialogTimeout();
}

if (this.router.url === '/welcome') {
this.router.navigate(['/']);
} else if (this.router.url !== '/' && !this.router.url.startsWith('/admin')) {

//avoids opening idle timeout box on initial page, admin page and while drawing
} else if (this.router.url !== '/' && !this.router.url.startsWith('/admin') && this.gameStateService.getCurrentPage() !== GAMESTATE.drawingBoard) {
this.openDialog();
}
});
Expand Down
2 changes: 2 additions & 0 deletions src/app/game/services/web-socket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export class WebSocketService {
this.handleConnectionError();
});

// Disable any type check for only this one because the spread parameter will take parameters of different types
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.socket.on('disconnect', (reason: any) => {
console.warn('disconnected', reason);
this.isConnected = false;
Expand Down

0 comments on commit e735e3e

Please sign in to comment.