Skip to content

Ask for confirmation before leaving a game #58

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,15 @@ setShowCountryButtons(false)


function backBtnPressed(queueNextGame = false, nextGameType) {
const isInGame = screen === "singleplayer" || multiplayerState?.inGame;

if (isInGame) {
const confirmLeave = window.confirm(text("confirmLeaveGame"));
if (!confirmLeave) {
return;
}
}

setStreetViewShown(false)
setOnboardingCompleted(true)

Expand Down Expand Up @@ -2504,4 +2513,3 @@ if(window.inCrazyGames) {
</>
)
}

3 changes: 2 additions & 1 deletion public/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,6 @@
"recentChange": "Sie haben kürzlich Ihren Namen geändert. Es kann bis zu 24 Stunden dauern, bis die Änderung vollständig aktualisiert ist.",
"nameChangeInProgress": "Ihre Namensänderung zu {{name}} ist in Bearbeitung. Es kann bis zu 24 Stunden dauern, bis sie vollständig aktualisiert ist.",
"nameChangeCooldown": "Sie können Ihren Namen in {{days}} Tagen erneut ändern",
"disableTimer": "Timer deaktivieren"
"disableTimer": "Timer deaktivieren",
"confirmLeaveGame": "Bist du sicher, dass du das Spiel verlassen möchtest?"
}
3 changes: 2 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,6 @@
"recentChange": "You have a recent name change. It can take up to 24 hours for it to fully update.",
"nameChangeInProgress": "Your name change to {{name}} is in progress, it can take up to 24 hours to fully update.",
"nameChangeCooldown": "You can change your name again in {{days}} days",
"disableTimer": "Disable Timer"
"disableTimer": "Disable Timer",
"confirmLeaveGame": "Are you sure you want to leave the game?"
}
3 changes: 2 additions & 1 deletion public/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,6 @@
"recentChange": "Ha realizado un cambio de nombre reciente. Puede tardar hasta 24 horas en actualizarse completamente.",
"nameChangeInProgress": "Su cambio de nombre a {{name}} está en proceso, puede tardar hasta 24 horas en actualizarse completamente.",
"nameChangeCooldown": "Puede cambiar su nombre nuevamente en {{days}} días",
"disableTimer": "Deshabilitar temporizador"
"disableTimer": "Deshabilitar temporizador",
"confirmLeaveGame": "¿Estás seguro de que quieres salir del juego?"
}
3 changes: 2 additions & 1 deletion public/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,6 @@
"recentChange": "Vous avez récemment changé de nom. Cela peut prendre jusqu'à 24 heures pour être complètement mis à jour.",
"nameChangeInProgress": "Votre changement de nom en {{name}} est en cours, cela peut prendre jusqu'à 24 heures pour être complètement mis à jour.",
"nameChangeCooldown": "Vous pourrez changer votre nom à nouveau dans {{days}} jours",
"disableTimer": "Désactiver le chronomètre"
"disableTimer": "Désactiver le chronomètre",
"confirmLeaveGame": "Êtes-vous sûr de vouloir quitter le jeu ?"
}
3 changes: 2 additions & 1 deletion public/locales/ru/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,6 @@
"recentChange": "Вы недавно изменили имя. Обновление может занять до 24 часов.",
"nameChangeInProgress": "Ваше имя изменяется на {{name}}, это может занять до 24 часов.",
"nameChangeCooldown": "Вы сможете изменить имя снова через {{days}} дней",
"disableTimer": "Отключить таймер"
"disableTimer": "Отключить таймер",
"confirmLeaveGame": "Вы уверены, что хотите покинуть игру?"
}