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 () => { const selectRootDirectory = async () => {
try { try {
return await ipcRenderer.sendSync('select-dir'); return await ipcRenderer.invoke('select-dir');
} catch (e) { } catch (e) {
console.error(e); console.error(e);
throw e; throw e;

View file

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

View file

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