diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-21 23:15:29 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-21 23:15:29 -0400 |
| commit | 4112393b17d25e54f1b8822734210b045da97613 (patch) | |
| tree | 7fd335fb69fc7bf2260acd72a505ae5476bbd6b6 /src/hooks/useLsfgHooks.ts | |
| parent | e54b7e2c5f3a736f248353317007f922771ab0c7 (diff) | |
| download | decky-lsfg-vk-4112393b17d25e54f1b8822734210b045da97613.tar.gz decky-lsfg-vk-4112393b17d25e54f1b8822734210b045da97613.zip | |
dry up with py generators for ts backends
Diffstat (limited to 'src/hooks/useLsfgHooks.ts')
| -rw-r--r-- | src/hooks/useLsfgHooks.ts | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/hooks/useLsfgHooks.ts b/src/hooks/useLsfgHooks.ts index e514d72..e5dea63 100644 --- a/src/hooks/useLsfgHooks.ts +++ b/src/hooks/useLsfgHooks.ts @@ -1,5 +1,4 @@ import { useState, useEffect, useCallback } from "react"; -import { toaster } from "@decky/api"; import { checkLsfgVkInstalled, checkLosslessScalingDll, @@ -8,6 +7,7 @@ import { type ConfigUpdateResult } from "../api/lsfgApi"; import { ConfigurationData, ConfigurationManager } from "../config/configSchema"; +import { showErrorToast, ToastMessages } from "../utils/toastUtils"; export function useInstallationStatus() { const [isInstalled, setIsInstalled] = useState<boolean>(false); @@ -95,17 +95,14 @@ export function useLsfgConfig() { if (result.success) { setConfig(newConfig); } else { - toaster.toast({ - title: "Update Failed", - body: result.error || "Failed to update configuration" - }); + showErrorToast( + ToastMessages.CONFIG_UPDATE_ERROR.title, + result.error || ToastMessages.CONFIG_UPDATE_ERROR.body + ); } return result; } catch (error) { - toaster.toast({ - title: "Update Failed", - body: `Error: ${error}` - }); + showErrorToast(ToastMessages.CONFIG_UPDATE_ERROR.title, String(error)); return { success: false, error: String(error) }; } }, []); |
