Fix a issue with folders that don't exist not showing an error
This commit is contained in:
@@ -11,11 +11,20 @@ export const openFolder = async (name: string) => {
|
|||||||
const folderExists = await exists(relativePath, {
|
const folderExists = await exists(relativePath, {
|
||||||
baseDir: BaseDirectory.AppLocalData
|
baseDir: BaseDirectory.AppLocalData
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!folderExists) {
|
||||||
|
await message(`Game folder "${absolutePath}" not found.`, {
|
||||||
|
title: 'Folder not found',
|
||||||
|
kind: 'error'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const folderStat = await stat(relativePath, {
|
const folderStat = await stat(relativePath, {
|
||||||
baseDir: BaseDirectory.AppLocalData
|
baseDir: BaseDirectory.AppLocalData
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!folderExists || folderStat.isFile) {
|
if (folderStat.isFile) {
|
||||||
await message(`Game folder "${absolutePath}" not found.`, {
|
await message(`Game folder "${absolutePath}" not found.`, {
|
||||||
title: 'Folder not found',
|
title: 'Folder not found',
|
||||||
kind: 'error'
|
kind: 'error'
|
||||||
|
|||||||
Reference in New Issue
Block a user