fix: only show open a directory when nfs api is supported

Also, ask for permission when clicking the refresh button
This commit is contained in:
Tienson Qin
2020-12-02 23:29:16 +08:00
parent 552ec6d1fa
commit bcb40c6629
4 changed files with 33 additions and 13 deletions

View File

@@ -139,3 +139,12 @@ export var verifyPermission = async function (handle, readWrite) {
// The user didn't grant permission, so return false.
return false;
}
export var nfsSupported = function () {
if ('chooseFileSystemEntries' in self) {
return 'chooseFileSystemEntries';
} else if ('showOpenFilePicker' in self) {
return 'showOpenFilePicker';
}
return false;
}