Merge branch 'main' into main

This commit is contained in:
Zamitto
2024-05-13 18:20:39 -03:00
committed by GitHub
13 changed files with 440 additions and 74 deletions

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}>