diff --git a/src/modules/qam-tab-page/components/QamRefreshButton.tsx b/src/modules/qam-tab-page/components/QamRefreshButton.tsx index 6ce94f2..7153616 100644 --- a/src/modules/qam-tab-page/components/QamRefreshButton.tsx +++ b/src/modules/qam-tab-page/components/QamRefreshButton.tsx @@ -1,16 +1,31 @@ import { ButtonItem, PanelSectionRow } from "@decky/ui"; import { useCSSLoaderAction, useCSSLoaderValue } from "@/backend"; +import { useEffect, useRef } from "react"; export function QamRefreshButton() { const reloadPlugin = useCSSLoaderAction("reloadPlugin"); const isWorking = useCSSLoaderValue("isWorking"); + + const refreshButtonRef = useRef(null); + + useEffect(() => { + console.log(refreshButtonRef.current); + }); + + async function handleRefresh() { + await reloadPlugin(); + // This just ensures focus isn't lost + refreshButtonRef.current?.focus(); + } + return ( { - console.log("TEST"); - void reloadPlugin(); + void handleRefresh(); }} layout="below" >