diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2026-09-11 11:08:12 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2026-09-11 11:08:12 -0400 |
| commit | 954b2abc47d8772211cb8ecee523900f823184e8 (patch) | |
| tree | c25109bebc87ccfb9e71a0863a10e81caa695908 /src/hooks/useLsfgHooks.ts | |
| parent | bc73d150230f92d614962f7384a7430cf64dcd14 (diff) | |
| download | decky-lsfg-vk-954b2abc47d8772211cb8ecee523900f823184e8.tar.gz decky-lsfg-vk-954b2abc47d8772211cb8ecee523900f823184e8.zip | |
better uninstall cleanup
Diffstat (limited to 'src/hooks/useLsfgHooks.ts')
| -rw-r--r-- | src/hooks/useLsfgHooks.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hooks/useLsfgHooks.ts b/src/hooks/useLsfgHooks.ts index 9beb749..0f51e90 100644 --- a/src/hooks/useLsfgHooks.ts +++ b/src/hooks/useLsfgHooks.ts @@ -13,7 +13,10 @@ import { showUninstallSuccessToast, } from "../utils/toastUtils"; -export function useInstallation(reloadConfig?: () => Promise<void>) { +export function useInstallation( + reloadConfig?: () => Promise<void>, + beforeUninstall?: () => Promise<boolean>, +) { const [isInstalled, setIsInstalled] = useState(false); const [installationStatus, setInstallationStatus] = useState(""); const [losslessScalingInstalled, setLosslessScalingInstalled] = useState(false); @@ -77,6 +80,10 @@ export function useInstallation(reloadConfig?: () => Promise<void>) { setIsUninstalling(true); setInstallationStatus("Uninstalling lsfg-vk..."); try { + if (beforeUninstall && !(await beforeUninstall())) { + setInstallationStatus("Uninstallation cancelled: could not clean up launch options"); + return; + } const result = await uninstallLsfgVk(); if (!result.success) { setInstallationStatus(`Uninstallation failed: ${result.error}`); |
