Skip to content

Commit

Permalink
Attempt to fix await loop on mobile, attempt 4
Browse files Browse the repository at this point in the history
Signed-off-by: William So <polyipseity@gmail.com>
  • Loading branch information
polyipseity committed Jul 25, 2023
1 parent 18a97fd commit 9fb1c76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sources/@types/obsidian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ interface $DataAdapter {
readonly getFullPath: (path: string) => string
readonly getFullRealPath: (realPath: string) => string
readonly getRealPath: (path: string) => string
readonly listAll: () => PromiseLike<void>
readonly listRecursive: (path: string) => PromiseLike<void>
readonly reconcileDeletion: (
realPath: string,
path: string,
Expand All @@ -53,7 +53,8 @@ interface $DataAdapter {
realPath: Deopaque<T> extends Platform.Mobile ? string : never,
path: Deopaque<T> extends Platform.Mobile ? string : never,
stat: Deopaque<T> extends Platform.Mobile ? MobileStat : never,
) => Deopaque<T> extends Platform.Mobile ? PromiseLike<void> : never
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) => Deopaque<T> extends Platform.Mobile ? void : never
readonly reconcileFileInternal: <T extends Platform.Current>(
realPath: Deopaque<T> extends Platform.Desktop ? string : never,
path: Deopaque<T> extends Platform.Desktop ? string : never,
Expand Down
4 changes: 2 additions & 2 deletions sources/show-hidden-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function patchVault(context: ShowHiddenFilesPlugin): void {
}, () => { })
workspace.onLayoutReady(async () =>
revealPrivateAsync(context, [adapter], async adapter0 =>
adapter0.listAll(), () => { }))
adapter0.listRecursive(""), () => { }))
}

function patchErrorMessage(context: ShowHiddenFilesPlugin): void {
Expand Down Expand Up @@ -278,7 +278,7 @@ async function showFile(context: PluginContext, path: string): Promise<void> {
const { type } = stat0
switch (type) {
case "file":
await adapter0.reconcileFileChanged<typeof CURRENT>(
adapter0.reconcileFileChanged<typeof CURRENT>(
realPath,
path,
stat,
Expand Down

0 comments on commit 9fb1c76

Please sign in to comment.