Skip to content

Commit

Permalink
refactor: rename state variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Hachi-R committed Jan 3, 2025
1 parent 29ba0cc commit b68fe30
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function GameOptionsModal({
const [launchOptions, setLaunchOptions] = useState(game.launchOptions ?? "");
const [showResetAchievementsModal, setShowResetAchievementsModal] =
useState(false);
const [isDeleting, setIsDeleting] = useState(false);
const [isDeletingAchievements, setIsDeletingAchievements] = useState(false);

const {
removeGameInstaller,
Expand Down Expand Up @@ -146,12 +146,12 @@ export function GameOptionsModal({
window.electron.platform === "linux";

const handleResetAchievements = async () => {
setIsDeleting(true);
setIsDeletingAchievements(true);
try {
await window.electron.resetGameAchievements(game.id);
} finally {
await updateGame();
setIsDeleting(false);
setIsDeletingAchievements(false);
}
};

Expand Down Expand Up @@ -338,7 +338,7 @@ export function GameOptionsModal({
<Button
onClick={() => setShowResetAchievementsModal(true)}
theme="danger"
disabled={deleting || isDeleting}
disabled={deleting || isDeletingAchievements}
>
{t("reset_achievements")}
</Button>
Expand Down

0 comments on commit b68fe30

Please sign in to comment.