fix async exists call (#2490)

`The file already exists` always pop up even that file doesn't exist.
This commit is contained in:
pan93412 2021-12-24 01:10:44 +08:00 committed by GitHub
parent 572ed9ee86
commit 186cc61f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -357,7 +357,7 @@ ipcMain.on('mt::rename', async (e, { id, pathname, newPathname }) => {
}) })
} }
if (!exists(newPathname)) { if (!await exists(newPathname)) {
doRename() doRename()
} else { } else {
const { response } = await dialog.showMessageBox(win, { const { response } = await dialog.showMessageBox(win, {