Messages now actually gets deleted
This commit is contained in:
@@ -95,6 +95,19 @@ export function setupSystemHandlers(): void {
|
||||
return true;
|
||||
});
|
||||
|
||||
ipcMain.handle('delete-file', async (_event, filePath: string) => {
|
||||
try {
|
||||
await fsp.unlink(filePath);
|
||||
return true;
|
||||
} catch (error) {
|
||||
if ((error as { code?: string }).code === 'ENOENT') {
|
||||
return true;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('save-file-as', async (_event, defaultFileName: string, base64Data: string) => {
|
||||
const result = await dialog.showSaveDialog({
|
||||
defaultPath: defaultFileName
|
||||
|
||||
Reference in New Issue
Block a user