address review comments

This commit is contained in:
Rushikesh Tote 2022-04-08 11:22:31 +05:30
parent 503045ab66
commit dd85af7698
3 changed files with 4 additions and 4 deletions

View file

@ -53,7 +53,7 @@ const saveFileToDisk = async (path: string, file: any) => {
const selectRootDirectory = async () => {
try {
return await ipcRenderer.sendSync('select-dir');
return await ipcRenderer.invoke('select-dir');
} catch (e) {
console.error(e);
throw e;

View file

@ -7,7 +7,7 @@ export default function setupIpcComs(
tray: Tray,
mainWindow: BrowserWindow
): void {
ipcMain.on('select-dir', async (event) => {
ipcMain.handle('select-dir', async () => {
const dialogWindow = new BrowserWindow({
width: 800,
height: 600,
@ -25,7 +25,7 @@ export default function setupIpcComs(
result.filePaths.length > 0 &&
result.filePaths[0];
dialogWindow.close();
event.returnValue = dir;
return dir;
});
ipcMain.on('update-tray', (event, args) => {

View file

@ -75,7 +75,7 @@ export const setToUploadFiles = (
if (filePaths && filePaths.length > 0) {
uploadStatusStore.set('filePaths', filePaths);
} else {
uploadStatusStore.delete('filePaths');
uploadStatusStore.set('filePaths', []);
}
if (collectionName) {
uploadStatusStore.set('collectionName', collectionName);