Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoids opening idle timeout box while drawing #268

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading