mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-12 05:48:25 -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';
|
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 () {
|
document.getElementById('btnExportOPFSEntry').addEventListener('click', function () {
|
||||||
params.exportOPFSEntry = !params.exportOPFSEntry;
|
params.exportOPFSEntry = !params.exportOPFSEntry;
|
||||||
var determinedTheme = params.cssUITheme == 'auto' ? cssUIThemeGetOrSet('auto', true) : params.cssUITheme;
|
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);
|
console.debug('Processing NativeFileHandle for ' + launchParams);
|
||||||
// Turn off OPFS if it is on, because we are using the File Handling API instead
|
// Turn off OPFS if it is on, because we are using the File Handling API instead
|
||||||
if (params.useOPFS) {
|
if (params.useOPFS) {
|
||||||
document.getElementById('useOPFSCheck').click();
|
params.useOPFS = false;
|
||||||
|
}
|
||||||
params.pickedFolder = '';
|
params.pickedFolder = '';
|
||||||
params.storedFile = '';
|
params.storedFile = '';
|
||||||
}
|
|
||||||
processNativeFileHandle(launchParams.files[0]);
|
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
|
// @STORAGE AUTOLOAD STARTS HERE
|
||||||
if ($.isFunction(navigator.getDeviceStorages)) {
|
if ($.isFunction(navigator.getDeviceStorages)) {
|
||||||
// The method getDeviceStorages is available (FxOS>=1.1)
|
// The method getDeviceStorages is available (FxOS>=1.1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user