Skip to content

Commit fa3fbde

Browse files
author
Devendra
committed
enhancements
1 parent c15e0b1 commit fa3fbde

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎web/examples/ttt.html‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,13 @@
177177

178178
}
179179
if (message['mtype'] == 'winner') {
180-
if (message['winner'] == pubnub.get_uuid()) {
181-
alert("You won");
182-
} else {
183-
alert("You lost");
180+
if (games[message['game_id']]) {
181+
if (message['winner'] == pubnub.get_uuid()) {
182+
alert("You won");
183+
} else {
184+
alert("You lost");
185+
}
186+
delete games[message['game_id']];
184187
}
185188
}
186189

0 commit comments

Comments
 (0)