summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 09:53:55 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 09:53:55 -0400
commite6efa4f0ff32d520982860180a29472068aab8e2 (patch)
tree62bddad9b84238c519bbe840cde36d5b78090e01 /src
parent840ea2802551a786de9b59f7aa00f04c5f335e2a (diff)
downloaddecky-lsfg-vk-e6efa4f0ff32d520982860180a29472068aab8e2.tar.gz
decky-lsfg-vk-e6efa4f0ff32d520982860180a29472068aab8e2.zip
simplify unhooked game behavior on mount
Diffstat (limited to 'src')
-rw-r--r--src/components/ConfigurationTab.tsx14
-rw-r--r--src/components/Content.tsx9
-rw-r--r--src/components/NowPlayingTab.tsx42
3 files changed, 10 insertions, 55 deletions
diff --git a/src/components/ConfigurationTab.tsx b/src/components/ConfigurationTab.tsx
index 8f8690c..8150819 100644
--- a/src/components/ConfigurationTab.tsx
+++ b/src/components/ConfigurationTab.tsx
@@ -37,7 +37,6 @@ export function ConfigurationTab({
const [focusDetailAction, setFocusDetailAction] = useState<"enable" | "fps" | null>(null);
const [focusConfiguredToggle, setFocusConfiguredToggle] = useState(false);
const enableRef = useRef<HTMLDivElement>(null);
- const promptedRunningAppId = useRef<string | null>(null);
const closeDetails = useCallback(() => {
setFocusFpsMultiplier(false);
setFocusDetailAction(null);
@@ -60,18 +59,6 @@ export function ConfigurationTab({
return () => cancelAnimationFrame(frame);
}, [focusDetailAction]);
- useEffect(() => {
- if (!runningGame || runningGame.configured) {
- promptedRunningAppId.current = null;
- return;
- }
- if (promptedRunningAppId.current !== runningGame.appid && detailAppId === null) {
- promptedRunningAppId.current = runningGame.appid;
- setFocusDetailAction("enable");
- setDetailAppId(runningGame.appid);
- }
- }, [detailAppId, runningGame?.appid, runningGame?.configured]);
-
const selectedTarget = detailAppId ? targets.find((target) => target.appid === detailAppId) : null;
if (detailAppId === null) {
@@ -106,7 +93,6 @@ export function ConfigurationTab({
: "Game is no longer available";
const handleProfileAction = async () => {
if (selectedTarget?.configured) {
- promptedRunningAppId.current = detailAppId;
await onReset();
setFocusConfiguredToggle(true);
closeDetails();
diff --git a/src/components/Content.tsx b/src/components/Content.tsx
index e5216ca..578f984 100644
--- a/src/components/Content.tsx
+++ b/src/components/Content.tsx
@@ -56,15 +56,15 @@ export function Content() {
setTab("Setup");
return;
}
- setTab((current) => current === "Setup" ? (runningGame ? "NowPlaying" : "Games") : current);
- }, [runningGame?.appid, setupComplete]);
+ setTab((current) => current === "Setup" ? (runningGame?.configured ? "NowPlaying" : "Games") : current);
+ }, [runningGame?.appid, runningGame?.configured, setupComplete]);
useEffect(() => {
if (!setupComplete) return;
const appid = runningGame?.appid || null;
const previous = previousRunningAppId.current;
previousRunningAppId.current = appid;
- if (appid && appid !== previous) setTab("NowPlaying");
+ if (appid && appid !== previous) setTab(runningGame?.configured ? "NowPlaying" : "Games");
else if (!appid && previous) {
setTab((current) => current === "NowPlaying" ? "Games" : current);
}
@@ -96,7 +96,7 @@ export function Content() {
const tabs = setupComplete
? [
- ...(runningGame ? [{
+ ...(runningGame?.configured ? [{
id: "NowPlaying",
title: tabIcons.nowPlaying,
content: (
@@ -104,7 +104,6 @@ export function Content() {
game={runningGame}
config={config}
onConfigChange={(field, value) => handleConfigChange(field, value)}
- onEnable={enable}
onRepair={repair}
/>
),
diff --git a/src/components/NowPlayingTab.tsx b/src/components/NowPlayingTab.tsx
index 5bce5c4..57858db 100644
--- a/src/components/NowPlayingTab.tsx
+++ b/src/components/NowPlayingTab.tsx
@@ -11,7 +11,6 @@ interface Props {
fieldName: keyof ConfigurationData,
value: boolean | number | string | string[],
) => Promise<void>;
- onEnable: (appid: string) => Promise<boolean>;
onRepair: (appid: string) => Promise<boolean>;
}
@@ -24,25 +23,13 @@ export function NowPlayingTab({
game,
config,
onConfigChange,
- onEnable,
onRepair,
}: Props) {
const [busy, setBusy] = useState(false);
const supportNeedsRepair =
- game.configured &&
game.transport.kind === "flatpak" &&
game.flatpakSupport?.support_status !== "ready";
- const handleEnable = async () => {
- if (busy) return;
- setBusy(true);
- try {
- await onEnable(game.appid);
- } finally {
- setBusy(false);
- }
- };
-
const handleRepair = async () => {
if (busy) return;
setBusy(true);
@@ -60,22 +47,7 @@ export function NowPlayingTab({
<Field label={game.name} description={targetDescription(game)} />
</PanelSectionRow>
</PanelSection>
- {!game.configured && (
- <PanelSection>
- <PanelSectionRow>
- <Field
- label="LSFG-VK is available"
- description="This target is not enabled yet. Create its AppID profile before the next launch."
- />
- </PanelSectionRow>
- <PanelSectionRow>
- <ButtonItem layout="below" disabled={busy} onClick={() => void handleEnable()}>
- {busy ? "Enabling..." : "Enable LSFG-VK"}
- </ButtonItem>
- </PanelSectionRow>
- </PanelSection>
- )}
- {game.configured && supportNeedsRepair && (
+ {supportNeedsRepair && (
<PanelSection>
<PanelSectionRow>
<Field
@@ -90,13 +62,11 @@ export function NowPlayingTab({
</PanelSectionRow>
</PanelSection>
)}
- {game.configured && (
- <GameConfigurationControls
- config={config}
- onConfigChange={onConfigChange}
- showWorkarounds={false}
- />
- )}
+ <GameConfigurationControls
+ config={config}
+ onConfigChange={onConfigChange}
+ showWorkarounds={false}
+ />
</Focusable>
);
}