From 4112393b17d25e54f1b8822734210b045da97613 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Mon, 21 Jul 2025 23:15:29 -0400 Subject: dry up with py generators for ts backends --- src/hooks/useLsfgHooks.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/hooks/useLsfgHooks.ts') 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(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) }; } }, []); -- cgit v1.2.3