From b45fc9a025be7490b56c8770d9cc0ea360ea5eb5 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Wed, 21 Sep 2022 15:06:04 +0100 Subject: [PATCH] fix: actually await some more promises in the local provider --- src/provider/local.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/provider/local.ts b/src/provider/local.ts index 8cb79b6..6549f98 100644 --- a/src/provider/local.ts +++ b/src/provider/local.ts @@ -40,7 +40,7 @@ async function localJson(comicId: string, path: string): Promise { if (parsed === null) return null; const [providerKey, id] = parsed; const pth = dataPath(`comics/${providerKey}/${id}/${path}`); - if (!pathExists(pth)) return null; + if (!await pathExists(pth)) return null; return JSON.parse(await FileSystem.readAsStringAsync(pth)); } @@ -48,7 +48,7 @@ async function localJson(comicId: string, path: string): Promise { const localProvider: LocalProvider = { async listComics() { const directory = dataPath('comics/'); - if (!pathExists(directory)) return []; + if (!await pathExists(directory)) return []; const providers = await FileSystem.readDirectoryAsync(directory) as NonLocalProviderKey[]; const comics: LocalComicMetadata[] = []; for (const provider of providers) {