mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-25 11:51:02 +00:00
feat: adjustments on clear button
This commit is contained in:
10
src/renderer/src/declaration.d.ts
vendored
10
src/renderer/src/declaration.d.ts
vendored
@@ -80,8 +80,14 @@ declare global {
|
||||
shop: GameShop
|
||||
) => Promise<void>;
|
||||
createGameShortcut: (id: number) => Promise<boolean>;
|
||||
updateExecutablePath: (id: number, executablePath: string) => Promise<void>;
|
||||
selectGameWinePrefix: (id: number, winePrefixPath: string) => Promise<void>;
|
||||
updateExecutablePath: (
|
||||
id: number,
|
||||
executablePath: string | null
|
||||
) => Promise<void>;
|
||||
selectGameWinePrefix: (
|
||||
id: number,
|
||||
winePrefixPath: string | null
|
||||
) => Promise<void>;
|
||||
verifyExecutablePathInUse: (executablePath: string) => Promise<Game>;
|
||||
getLibrary: () => Promise<LibraryGame[]>;
|
||||
openGameInstaller: (gameId: number) => Promise<boolean>;
|
||||
|
||||
@@ -96,7 +96,7 @@ export function GameOptionsModal({
|
||||
};
|
||||
|
||||
const handleClearExecutablePath = async () => {
|
||||
await window.electron.updateExecutablePath(game.id, "");
|
||||
await window.electron.updateExecutablePath(game.id, null);
|
||||
updateGame();
|
||||
};
|
||||
|
||||
@@ -112,7 +112,7 @@ export function GameOptionsModal({
|
||||
};
|
||||
|
||||
const handleClearWinePrefixPath = async () => {
|
||||
await window.electron.selectGameWinePrefix(game.id, "");
|
||||
await window.electron.selectGameWinePrefix(game.id, null);
|
||||
updateGame();
|
||||
};
|
||||
|
||||
@@ -155,14 +155,21 @@ export function GameOptionsModal({
|
||||
disabled
|
||||
placeholder={t("no_executable_selected")}
|
||||
rightContent={
|
||||
<Button
|
||||
type="button"
|
||||
theme="outline"
|
||||
onClick={handleChangeExecutableLocation}
|
||||
>
|
||||
<FileIcon />
|
||||
{t("select_executable")}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
theme="outline"
|
||||
onClick={handleChangeExecutableLocation}
|
||||
>
|
||||
<FileIcon />
|
||||
{t("select_executable")}
|
||||
</Button>
|
||||
{game.executablePath && (
|
||||
<Button onClick={handleClearExecutablePath} theme="outline">
|
||||
{t("clear")}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -178,9 +185,6 @@ export function GameOptionsModal({
|
||||
<Button onClick={handleCreateShortcut} theme="outline">
|
||||
{t("create_shortcut")}
|
||||
</Button>
|
||||
<Button onClick={handleClearExecutablePath} theme="outline">
|
||||
{t("clear")}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -199,23 +203,26 @@ export function GameOptionsModal({
|
||||
disabled
|
||||
placeholder={t("no_directory_selected")}
|
||||
rightContent={
|
||||
<Button
|
||||
type="button"
|
||||
theme="outline"
|
||||
onClick={handleChangeWinePrefixPath}
|
||||
>
|
||||
<FileDirectoryIcon />
|
||||
{t("select_executable")}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
theme="outline"
|
||||
onClick={handleChangeWinePrefixPath}
|
||||
>
|
||||
<FileDirectoryIcon />
|
||||
{t("select_executable")}
|
||||
</Button>
|
||||
{game.winePrefixPath && (
|
||||
<Button
|
||||
onClick={handleClearWinePrefixPath}
|
||||
theme="outline"
|
||||
>
|
||||
{t("clear")}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
{game.winePrefixPath && (
|
||||
<div className={styles.gameOptionRow}>
|
||||
<Button onClick={handleClearWinePrefixPath} theme="outline">
|
||||
{t("clear")}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user