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", "@typescript-eslint/no-explicit-any": "warn",
"prettier/prettier": [
"error",
{
endOfLine: "auto",
},
],
}, },
}; };

View File

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

View File

@ -124,21 +124,20 @@ export class TorrentDownloader extends Downloader {
stdio: "inherit", stdio: "inherit",
windowsHide: true, windowsHide: true,
}); });
return; } else {
const scriptPath = path.join(
__dirname,
"..",
"..",
"torrent-client",
"main.py"
);
cp.spawn("python3", [scriptPath, ...commonArgs], {
stdio: "inherit",
});
} }
const scriptPath = path.join(
__dirname,
"..",
"..",
"torrent-client",
"main.py"
);
cp.spawn("python3", [scriptPath, ...commonArgs], {
stdio: "inherit",
});
Promise.all([writePipe.createPipe(), readPipe.createPipe()]).then( Promise.all([writePipe.createPipe(), readPipe.createPipe()]).then(
async () => { async () => {
this.attachListener(); this.attachListener();

View File

@ -29,7 +29,7 @@ export const getSteamGridData = async (
const searchParams = new URLSearchParams(params); const searchParams = new URLSearchParams(params);
if (!import.meta.env.MAIN_VITE_STEAMGRIDDB_API_KEY) { 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( const response = await axios.get(

View File

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