delete button and function implemented, help page

This commit is contained in:
santa
2026-01-10 14:22:27 +01:00
parent ed5a86dce0
commit 12f99e9f2b
4 changed files with 120 additions and 71 deletions
+14 -1
View File
@@ -281,8 +281,21 @@ electron.ipcMain.handle('save-txt-file', (event, fileName, content) => {
return true;
});
//
//read file content
electron.ipcMain.handle('read-txt-file', (event, fileName) => {
const filePath = `${mainDir}/storage/documentType/${fileName}`;
return fs.readFileSync(filePath, 'utf8');
});
//delete documentfiles
electron.ipcMain.handle('delete-txt-file', (event, fileName) => {
const filePath = `${mainDir}/storage/documentType/${fileName}.txt`;
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
return true;
} else {
return false;
}
});