mirror of
https://github.com/LifeArchiveProject/WeChatDataAnalysis.git
synced 2026-02-20 14:50:50 +08:00
improvement(chat): 优化导出筛选与目录选择体验
This commit is contained in:
@@ -611,6 +611,25 @@ function registerWindowIpc() {
|
||||
return getCloseBehavior();
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle("dialog:chooseDirectory", async (_event, options) => {
|
||||
try {
|
||||
const result = await dialog.showOpenDialog({
|
||||
title: String(options?.title || "选择文件夹"),
|
||||
properties: ["openDirectory", "createDirectory"],
|
||||
});
|
||||
return {
|
||||
canceled: !!result?.canceled,
|
||||
filePaths: Array.isArray(result?.filePaths) ? result.filePaths : [],
|
||||
};
|
||||
} catch (err) {
|
||||
logMain(`[main] dialog:chooseDirectory failed: ${err?.message || err}`);
|
||||
return {
|
||||
canceled: true,
|
||||
filePaths: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function main() {
|
||||
|
||||
Reference in New Issue
Block a user