summaryrefslogtreecommitdiff
path: root/src/hooks/useLsfgHooks.ts
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-11 11:08:12 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-11 11:08:12 -0400
commit954b2abc47d8772211cb8ecee523900f823184e8 (patch)
treec25109bebc87ccfb9e71a0863a10e81caa695908 /src/hooks/useLsfgHooks.ts
parentbc73d150230f92d614962f7384a7430cf64dcd14 (diff)
downloaddecky-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.ts9
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}`);