fixing notifications again

This commit is contained in:
Jonas Weinz 2019-03-21 16:06:18 +01:00
parent f37cab9cc6
commit 5e19473e53
3 changed files with 5 additions and 6 deletions

View File

@ -28,11 +28,6 @@ class OnlineMatchManager
this.match_button.className = "infobar-button-active"; this.match_button.className = "infobar-button-active";
if (this.match_state.active_player == this.local_player.get_name())
{
this.game_server_connection.notify("your turn against " + this.online_opponent.get_name());
}
this.is_closed = false; this.is_closed = false;
} }

2
sw.js
View File

@ -39,5 +39,5 @@ self.addEventListener('fetch', function (event) {
self.addEventListener('notificationclick', function (event) { self.addEventListener('notificationclick', function (event) {
event.notification.close(); event.notification.close();
clients.openWindow(rel_home); clients.openWindow(home);
}); });

View File

@ -182,6 +182,10 @@ class WebsocketConnection
if (!match_state.game_over) if (!match_state.game_over)
{ {
this.openmatches[id] = new OnlineMatchManager(this.grid, this.status_label, this.matches_container, this.control_container, this, id, match_state, this.player.get_name()); this.openmatches[id] = new OnlineMatchManager(this.grid, this.status_label, this.matches_container, this.control_container, this, id, match_state, this.player.get_name());
if (match_state.last_move == null)
{
this.notify("new Game against " + this.openmatches[id].online_opponent.get_name());
}
} }
} }