add clear electron store
This commit is contained in:
parent
5addfdd9ea
commit
f098bcd3ed
|
@ -1,5 +1,6 @@
|
|||
import { ipcRenderer } from 'electron/renderer';
|
||||
import { logError } from '../utils/logging';
|
||||
import { keysStore, uploadStatusStore, watchStore } from '../services/store';
|
||||
|
||||
export const selectRootDirectory = async () => {
|
||||
try {
|
||||
|
@ -8,3 +9,13 @@ export const selectRootDirectory = async () => {
|
|||
logError(e, 'error while selecting root directory');
|
||||
}
|
||||
};
|
||||
|
||||
export const clearElectronStore = () => {
|
||||
try {
|
||||
watchStore.clear();
|
||||
uploadStatusStore.clear();
|
||||
keysStore.clear();
|
||||
} catch (e) {
|
||||
logError(e, 'error while clearing electron store');
|
||||
}
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@ import {
|
|||
setExportRecord,
|
||||
exists,
|
||||
} from './api/export';
|
||||
import { selectRootDirectory } from './api/common';
|
||||
import { selectRootDirectory, clearElectronStore } from './api/common';
|
||||
import { getElectronFile, doesFolderExists } from './services/fs';
|
||||
|
||||
const windowObject: any = window;
|
||||
|
@ -41,6 +41,7 @@ windowObject['ElectronAPIs'] = {
|
|||
saveStreamToDisk,
|
||||
saveFileToDisk,
|
||||
selectRootDirectory,
|
||||
clearElectronStore,
|
||||
sendNotification,
|
||||
showOnTray,
|
||||
reloadWindow,
|
||||
|
|
Loading…
Reference in a new issue