Skip to content

Commit

Permalink
Simplify confirmation of deletion of leaderboards by asking to type "…
Browse files Browse the repository at this point in the history
…delete" instead of the full leaderboard name (#5596)
  • Loading branch information
Bouh authored Aug 23, 2023
1 parent f86fcf4 commit 7a360b0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions newIDE/app/src/GameDashboard/LeaderboardAdmin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,19 @@ export const LeaderboardAdmin = ({

const onDeleteLeaderboard = async (i18n: I18nType) => {
if (!currentLeaderboard) return;
const answer = await showDeleteConfirmation({
title: t`Delete leaderboard ${currentLeaderboard.name}`,
message: t`Are you sure you want to delete this leaderboard and all of its entries? This can't be undone.`,
// Extract word translation to ensure it is not wrongly translated in the sentence.
const translatedConfirmText = i18n._(t`delete`);

const deleteAnswer = await showDeleteConfirmation({
title: t`Do you really want to permanently delete the leaderboard ${
currentLeaderboard.name
}?`,
message: t`You’re about to permanently delete this leaderboard and all of its entries. This can't be undone.`,
fieldMessage: t`To confirm, type "${translatedConfirmText}"`,
confirmText: translatedConfirmText,
confirmButtonLabel: t`Delete Leaderboard`,
confirmText: currentLeaderboard.name,
fieldMessage: t`Type the name of the leaderboard:`,
});
if (!answer) return;
if (!deleteAnswer) return;

setIsLoading(true);
setApiError(null);
Expand Down

0 comments on commit 7a360b0

Please sign in to comment.