This commit is contained in:
Manav Rathi 2024-04-14 19:46:26 +05:30
parent f9560ec533
commit 881a963fde
No known key found for this signature in database

View file

@ -77,14 +77,6 @@ export default function ExportModal(props: Props) {
void syncExportRecord(exportFolder);
}, [props.show]);
// =============
// STATE UPDATERS
// ==============
const updateExportFolder = (newFolder: string) => {
exportService.updateExportSettings({ folder: newFolder });
setExportFolder(newFolder);
};
// ======================
// HELPER FUNCTIONS
// =======================
@ -128,7 +120,8 @@ export default function ExportModal(props: Props) {
try {
const newFolder = await exportService.changeExportDirectory();
log.info(`Export folder changed to ${newFolder}`);
updateExportFolder(newFolder);
exportService.updateExportSettings({ folder: newFolder });
setExportFolder(newFolder);
void syncExportRecord(newFolder);
} catch (e) {
if (e.message !== CustomError.SELECT_FOLDER_ABORTED) {