Skip to content

Commit

Permalink
fix(xod-client-electron): prevent showing error message twice on IDE …
Browse files Browse the repository at this point in the history
…startup
  • Loading branch information
brusherru committed Feb 17, 2021
1 parent 0e50592 commit 681f3f9
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions packages/xod-client-electron/src/app/workspaceActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,18 @@ export const onIDELaunch = R.curry(
}),
getFileToOpen()
)
)()
.catch(
catchInvalidWorkspace(err => {
const isHomeDir = oldPath !== newPath;
const forceCreate =
err.errorCode === FS_ERROR_CODES.WORKSPACE_DIR_NOT_EMPTY;
if (isHomeDir && !forceCreate) {
return onCreateWorkspace(send, pathSaver, newPath);
}
requestCreateWorkspace(send, newPath, forceCreate);
return [];
})
)
.catch(handleError(send));
)().catch(
catchInvalidWorkspace(err => {
const isHomeDir = oldPath !== newPath;
const forceCreate =
err.errorCode === FS_ERROR_CODES.WORKSPACE_DIR_NOT_EMPTY;
if (isHomeDir && !forceCreate) {
return onCreateWorkspace(send, pathSaver, newPath);
}
requestCreateWorkspace(send, newPath, forceCreate);
return [];
})
);
}
);

Expand Down

0 comments on commit 681f3f9

Please sign in to comment.