fix: actually await some more promises in the local provider
This commit is contained in:
parent
c615b2e0c1
commit
b45fc9a025
1 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ async function localJson<T>(comicId: string, path: string): Promise<T | null> {
|
|||
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<T>(comicId: string, path: string): Promise<T | null> {
|
|||
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) {
|
||||
|
|
Loading…
Reference in a new issue