Skip to content

Commit

Permalink
fix(mobile): readdir with empty base path
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Aug 24, 2022
1 parent 9b0bc8a commit 1c38b91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/myAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ export class MyAdapter {
path = "/";
const res = await this.adapter.list(path);
const all = [...res.files, ...res.folders];
let formattedAll = all.map(e => normalizePath(e.substring(path.length)));

let formattedAll;
if (path !== "/") {
formattedAll = all.map(e => normalizePath(e.substring(path.length)));
} else {
formattedAll = all;
}
return formattedAll;
}
async mkdir(path: string) {
Expand Down

0 comments on commit 1c38b91

Please sign in to comment.