fix(frontend): confirm leaving a game with Yes and go home
The dialog's buttons were in the wrong order and its result was read inverted; leaving now needs Yes and returns to the home page.
This commit is contained in:
parent
b472c2813c
commit
08fc5c8b7b
@ -182,12 +182,13 @@ const GamePage: FunctionComponent<{
|
||||
swal({
|
||||
title: t("AreYouSureToLeaveGame"),
|
||||
icon: "warning",
|
||||
buttons: [t("Yes"), t("Cancel")],
|
||||
buttons: [t("Cancel"), t("Yes")],
|
||||
dangerMode: true,
|
||||
})
|
||||
.then((cancel) => {
|
||||
if (!cancel) {
|
||||
.then((confirm) => {
|
||||
if (confirm) {
|
||||
context.rtmt.sendMessage(channel_leave_game, {});
|
||||
navigate("/");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user