mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-23 12:36:21 -04:00
Make a first access to device storage before looking for archives, in order to ask the user for confirmation only once. This avoids a very annoying behavior on first startup of the application. Fixes #85
This commit is contained in:
parent
0367e60674
commit
7f35248c5b
@ -238,7 +238,10 @@ define(function(require) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (storages !== null && storages.length > 0) {
|
if (storages !== null && storages.length > 0) {
|
||||||
searchForArchivesInPreferencesOrStorage();
|
// Make a fake first access to device storage, in order to ask the user for confirmation if necessary.
|
||||||
|
// This way, it is only done once at this moment, instead of being done several times in callbacks
|
||||||
|
// After that, we can start looking for archives
|
||||||
|
storages[0].get("fake-file-to-read").always(searchForArchivesInPreferencesOrStorage);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If DeviceStorage is not available, we display the file select components
|
// If DeviceStorage is not available, we display the file select components
|
||||||
|
Loading…
x
Reference in New Issue
Block a user