Prevent interference between launchQueue and OPFS

This commit is contained in:
Jaifroid 2023-10-06 11:28:52 +01:00
parent 4a615f1303
commit d24becca14

View File

@ -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.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)