feat: implement settings engine with directory picker and aria2 configuration sync

This commit is contained in:
NimBold
2026-06-16 15:10:29 +03:30
parent 275eb6e5c4
commit 85cdabd72b
5 changed files with 140 additions and 5 deletions
+22
View File
@@ -0,0 +1,22 @@
import { open } from '@tauri-apps/plugin-dialog';
export const useDirectoryPicker = () => {
const pickDirectory = async (defaultPath?: string): Promise<string | null> => {
try {
const selected = await open({
directory: true,
multiple: false,
defaultPath: defaultPath,
});
if (selected && typeof selected === 'string') {
return selected;
}
return null;
} catch (e) {
console.error('Failed to pick directory:', e);
return null;
}
};
return { pickDirectory };
};