mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
refactor: rename state variable for clarity
This commit is contained in:
parent
29ba0cca85
commit
b68fe300ba
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user