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

buxfix: "urgent" game notification handling #2905

Merged
merged 1 commit into from
Jan 1, 2025
Merged
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
14 changes: 7 additions & 7 deletions src/components/Notifications/NotificationManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export class NotificationManager {
notifications: { [k: string]: Notification };
ordered_notifications: Notification[];
unread_notification_count: number = 0;
boards_to_move_on: { [k: string]: any };
active_boards: { [k: string]: any };
boards_to_move_on: { [k: string]: GameListEntry };
active_boards: { [k: string]: GameListEntry };
advances: number = 0;
auth: string | undefined;
event_emitter: TypedEventEmitter<NotificationManagerEvents>;
Expand Down Expand Up @@ -239,8 +239,8 @@ export class NotificationManager {
for (const k in this.boards_to_move_on) {
const board = this.boards_to_move_on[k];
target_boards.push({
id: parseInt(board.id),
expiration: parseInt(board.clock_expiration),
id: Number(board.id),
expiration: Number(board.clock_expiration),
});
}

Expand All @@ -249,8 +249,8 @@ export class NotificationManager {
for (const k in this.active_boards) {
const board = this.active_boards[k];
target_boards.push({
id: parseInt(board.id),
expiration: parseInt(board.clock_expiration),
id: Number(board.id),
expiration: Number(board.clock_expiration),
});
}
} else {
Expand Down Expand Up @@ -289,7 +289,7 @@ export class NotificationManager {
// the we go to the most urgent.
if (
we_have_moves_to_play &&
(!looking_at_game_id || (!click_event && looking_at_game_details.time_to_move < 3600))
(!looking_at_game_id || (!click_event && looking_at_game_details.time_per_move < 3600))
) {
this.advances = 1; // reset to the most urgent board
}
Expand Down
Loading