fix: fixing named pipes on windows

This commit is contained in:
Chubby Granny Chaser 2024-05-13 22:01:34 +01:00
parent c71eeb2b9b
commit 820cf65d13
5 changed files with 25 additions and 20 deletions

View File

@ -19,5 +19,11 @@ module.exports = {
},
],
"@typescript-eslint/no-explicit-any": "warn",
"prettier/prettier": [
"error",
{
endOfLine: "auto",
},
],
},
};

View File

@ -1 +0,0 @@
npx --no -- commitlint --edit $1

View File

@ -124,9 +124,7 @@ export class TorrentDownloader extends Downloader {
stdio: "inherit",
windowsHide: true,
});
return;
}
} else {
const scriptPath = path.join(
__dirname,
"..",
@ -138,6 +136,7 @@ export class TorrentDownloader extends Downloader {
cp.spawn("python3", [scriptPath, ...commonArgs], {
stdio: "inherit",
});
}
Promise.all([writePipe.createPipe(), readPipe.createPipe()]).then(
async () => {

View File

@ -29,7 +29,7 @@ export const getSteamGridData = async (
const searchParams = new URLSearchParams(params);
if (!import.meta.env.MAIN_VITE_STEAMGRIDDB_API_KEY) {
throw new Error("STEAMGRIDDB_API_KEY is not set");
throw new Error("MAIN_VITE_STEAMGRIDDB_API_KEY is not set");
}
const response = await axios.get(

View File

@ -45,6 +45,11 @@ export function SettingsGeneral({
const { t } = useTranslation("settings");
const handleChange = (values: Partial<typeof form>) => {
setForm((prev) => ({ ...prev, ...values }));
updateUserPreferences(values);
};
const handleChooseDownloadsPath = async () => {
const { filePaths } = await window.electron.showOpenDialog({
defaultPath: form.downloadsPath,
@ -53,15 +58,11 @@ export function SettingsGeneral({
if (filePaths && filePaths.length > 0) {
const path = filePaths[0];
handleChange({ downloadsPath: path });
updateUserPreferences({ downloadsPath: path });
}
};
const handleChange = (values: Partial<typeof form>) => {
setForm((prev) => ({ ...prev, ...values }));
updateUserPreferences(values);
};
return (
<>
<div className={styles.downloadsPathField}>