diff --git a/js/GUI/Screen/Game.js b/js/GUI/Screen/Game.js index 6738935..9d28287 100644 --- a/js/GUI/Screen/Game.js +++ b/js/GUI/Screen/Game.js @@ -38,13 +38,15 @@ function init(gameID) { ); } +function backToMain() { + window.location = '..'; +} + function fail(errorCode) { return function(f) { Screen.dialog({ text: I18n.get(errorCode), - answers: [ - {label: 'backToMain', action: function() {window.location = '..';}} - ] + answers: [{label: 'backToMain', action: backToMain}] }); } } @@ -160,14 +162,7 @@ function gameEnd(o, f) { } Screen.dialog({ text: I18n.get(Session.is(winner) ? 'won' : 'lost'), - answers: [{ - label: 'endGame', - action: function() { - Messaging.send({tag: "Quit"}); - Screen.select('reception'); - f(); - } - }] + answers: [{label: 'endGame', action: backToMain}] }); }