* Ask a user action via dialog and returns the directory handler once granted. * @param {string} uid * @param {{id?:string, mode?:"read"|"readwrite", hint?:"desktop"|"documents"|"downloads"|"music"|"pictures"|"videos"}} options * @returns {Promise }
(uid, options = {})
| 21 | * @returns {Promise<boolean>} |
| 22 | */ |
| 23 | async storeFSHandler(uid, options = {}) { |
| 24 | if (await idb.has(uid)) return true; |
| 25 | return getFileSystemDirectoryHandle(options).then( |
| 26 | async (handler) => { |
| 27 | await idb.set(uid, { handler, options }); |
| 28 | return true; |
| 29 | }, |
| 30 | () => false, |
| 31 | ); |
| 32 | }, |
| 33 | |
| 34 | /** |
| 35 | * Explicitly remove the unique identifier for the FS handler. |
nothing calls this directly
no test coverage detected