mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-11 05:08:43 -04:00
Prevent interference between launchQueue and OPFS
This commit is contained in:
parent
4a615f1303
commit
d24becca14
@ -1562,12 +1562,7 @@ function setOPFSUI () {
|
||||
btnExportOPFSEntry.style.display = 'none';
|
||||
}
|
||||
}
|
||||
// Set the OPFS UI no app launch
|
||||
setOPFSUI();
|
||||
// If user had previously set the app to use the OPFS directory, attempt to launch any ZIM in it
|
||||
// if (params.useOPFS) {
|
||||
// loadOPFSDirectory();
|
||||
// }
|
||||
|
||||
document.getElementById('btnExportOPFSEntry').addEventListener('click', function () {
|
||||
params.exportOPFSEntry = !params.exportOPFSEntry;
|
||||
var determinedTheme = params.cssUITheme == 'auto' ? cssUIThemeGetOrSet('auto', true) : params.cssUITheme;
|
||||
@ -3029,15 +3024,18 @@ if ('launchQueue' in window && 'files' in LaunchParams.prototype) {
|
||||
console.debug('Processing NativeFileHandle for ' + launchParams);
|
||||
// Turn off OPFS if it is on, because we are using the File Handling API instead
|
||||
if (params.useOPFS) {
|
||||
document.getElementById('useOPFSCheck').click();
|
||||
params.pickedFolder = '';
|
||||
params.storedFile = '';
|
||||
params.useOPFS = false;
|
||||
}
|
||||
params.pickedFolder = '';
|
||||
params.storedFile = '';
|
||||
processNativeFileHandle(launchParams.files[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Set the OPFS UI on app launch (this needs to run after the launchQueue above, as it may turn off OPFS)
|
||||
setOPFSUI();
|
||||
|
||||
// @STORAGE AUTOLOAD STARTS HERE
|
||||
if ($.isFunction(navigator.getDeviceStorages)) {
|
||||
// The method getDeviceStorages is available (FxOS>=1.1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user