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:
Halit Aksoy 2026-10-16 09:26:02 +03:00
parent b472c2813c
commit 08fc5c8b7b

View File

@ -182,12 +182,13 @@ const GamePage: FunctionComponent<{
swal({ swal({
title: t("AreYouSureToLeaveGame"), title: t("AreYouSureToLeaveGame"),
icon: "warning", icon: "warning",
buttons: [t("Yes"), t("Cancel")], buttons: [t("Cancel"), t("Yes")],
dangerMode: true, dangerMode: true,
}) })
.then((cancel) => { .then((confirm) => {
if (!cancel) { if (confirm) {
context.rtmt.sendMessage(channel_leave_game, {}); context.rtmt.sendMessage(channel_leave_game, {});
navigate("/");
} }
}); });
}; };