mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-13 07:03:58 +00:00
enhance: optimize Privacy page UX, copy, and performan… PR256 (#261)
This commit is contained in:
commit
b8473fc3b8
3 changed files with 9 additions and 4 deletions
|
|
@ -380,7 +380,9 @@ export class FileReader {
|
|||
});
|
||||
|
||||
fileStream.on('error', (err) => {
|
||||
fs.unlink(localPath, () => { }); // delete incomplete file
|
||||
fs.unlink(localPath, (unlinkErr) => {
|
||||
if (unlinkErr) console.error('Failed to delete incomplete file:', unlinkErr);
|
||||
}); // delete incomplete file
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -644,7 +644,8 @@ function registerIpcHandlers() {
|
|||
|
||||
ipcMain.handle("reveal-in-folder", async (event, filePath: string) => {
|
||||
try {
|
||||
if (filePath.endsWith('/')) {
|
||||
const stats = await fs.promises.stat(filePath.replace(/\/$/, '')).catch(() => null);
|
||||
if (stats && stats.isDirectory()) {
|
||||
shell.openPath(filePath);
|
||||
} else {
|
||||
shell.showItemInFolder(filePath);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,9 @@ export default function SettingPrivacy() {
|
|||
}, [email]);
|
||||
|
||||
const handleOpenFolder = () => {
|
||||
window.ipcRenderer.invoke("reveal-in-folder", logFolder + "/");
|
||||
if (logFolder) {
|
||||
window.ipcRenderer.invoke("reveal-in-folder", logFolder + "/");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -172,7 +174,7 @@ export default function SettingPrivacy() {
|
|||
<FolderSearch className="w-4 h-4 ml-2" />
|
||||
</div>
|
||||
</div>
|
||||
<Button onClick={handleOpenFolder} size="sm">
|
||||
<Button onClick={handleOpenFolder} size="sm" disabled={!logFolder}>
|
||||
Open Folder
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue