Merge branch 'master' into enhance/undo-redo

This commit is contained in:
Tienson Qin
2021-01-12 05:12:32 -08:00
committed by GitHub
11 changed files with 108 additions and 26 deletions

View File

@@ -128,10 +128,10 @@ export var verifyPermission = async function (handle, readWrite) {
throw new Error("Permission is not granted");
}
// NOTE: Need externs to prevent `options.recursive` been munged
// When building with release.
export var openDirectory = async function (options = {}, cb) {
// FIXME: options.recursive will be undefined after the `getFiles` call get resolved
// It's caused by bumping shadow-cljs to 2.11.11.
options.recursive = true;
options.recursive = options.recursive || false;
const handle = await window.showDirectoryPicker({ mode: 'readwrite' });
const _ask = await verifyPermission(handle, true);
return [handle, getFiles(handle, options.recursive, cb)];