Skip to content

Commit 163a525

Browse files
committed
Avoid switch to main and back on reconnect.
Upon reconnection during a game, it was switching back to the main page, then receiving the message to re-enter a game. Now it stays where it is (in the game page) until server sends game or no_games message, which puts you in the main page.
1 parent 583e3fc commit 163a525

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

public/javascripts/c4.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ var C4 = {
209209
C4.remove_handler(C4.cb_welcome);
210210
C4.add_handler(C4.cb_seek_notifications);
211211
C4.add_handler(C4.cb_new_game);
212-
$.mobile.changePage($("#main"));
213212
return true;
214213
} else
215214
return false;
@@ -240,7 +239,11 @@ var C4 = {
240239
if (m = msg.match(/^DUPLICATE_SEEK (\d+)$/)) {
241240
return true;
242241
}
243-
242+
243+
if (msg.match(/^NO_GAMES$/)){
244+
$.mobile.changePage($("#main"));
245+
return true;
246+
}
244247
return false;
245248
},
246249
quit_game : function() {

0 commit comments

Comments
 (0)