Enable deleting all indexed desktop files from Khoj via Desktop app

This commit is contained in:
Debanjum Singh Solanky
2023-11-07 03:37:16 -08:00
parent 779fa531a5
commit 7c424e0d5f
4 changed files with 25 additions and 1 deletions

View File

@@ -317,6 +317,19 @@ async function syncData (regenerate = false) {
}
}
async function deleteAllFiles () {
try {
store.set('files', []);
store.set('folders', []);
pushDataToKhoj(true);
const date = new Date();
console.log('Pushing data to Khoj at: ', date);
} catch (err) {
console.error(err);
}
}
let firstRun = true;
let win = null;
const createWindow = (tab = 'chat.html') => {
@@ -397,6 +410,7 @@ app.whenReady().then(() => {
ipcMain.handle('syncData', (event, regenerate) => {
syncData(regenerate);
});
ipcMain.handle('deleteAllFiles', deleteAllFiles);
createWindow()