address review comments
This commit is contained in:
parent
503045ab66
commit
dd85af7698
|
@ -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;
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue