refactor: rename state variable for clarity

This commit is contained in:
Hachi-R 2025-01-03 17:24:37 -03:00
parent 29ba0cca85
commit b68fe300ba

View File

@ -34,7 +34,7 @@ export function GameOptionsModal({
const [launchOptions, setLaunchOptions] = useState(game.launchOptions ?? ""); const [launchOptions, setLaunchOptions] = useState(game.launchOptions ?? "");
const [showResetAchievementsModal, setShowResetAchievementsModal] = const [showResetAchievementsModal, setShowResetAchievementsModal] =
useState(false); useState(false);
const [isDeleting, setIsDeleting] = useState(false); const [isDeletingAchievements, setIsDeletingAchievements] = useState(false);
const { const {
removeGameInstaller, removeGameInstaller,
@ -146,12 +146,12 @@ export function GameOptionsModal({
window.electron.platform === "linux"; window.electron.platform === "linux";
const handleResetAchievements = async () => { const handleResetAchievements = async () => {
setIsDeleting(true); setIsDeletingAchievements(true);
try { try {
await window.electron.resetGameAchievements(game.id); await window.electron.resetGameAchievements(game.id);
} finally { } finally {
await updateGame(); await updateGame();
setIsDeleting(false); setIsDeletingAchievements(false);
} }
}; };
@ -338,7 +338,7 @@ export function GameOptionsModal({
<Button <Button
onClick={() => setShowResetAchievementsModal(true)} onClick={() => setShowResetAchievementsModal(true)}
theme="danger" theme="danger"
disabled={deleting || isDeleting} disabled={deleting || isDeletingAchievements}
> >
{t("reset_achievements")} {t("reset_achievements")}
</Button> </Button>