updated settings storage
This commit is contained in:
parent
173908e504
commit
bcd5328b80
@ -82,39 +82,39 @@ export class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
||||
installButton.classList.remove("hidden");
|
||||
});
|
||||
|
||||
// let storageManager = MyStorageManager.getInstance();
|
||||
// if (storageManager.canEstimateStorage()) {
|
||||
// console.log("can estimate storage!");
|
||||
// Promise.all([storageManager.estimate(), storageManager.isPersistent()]).then(res => {
|
||||
// let storage = res[0];
|
||||
// let isPersisted = res[1];
|
||||
// let storageObject = this.findBy("#storage-info");
|
||||
// console.log(isPersisted);
|
||||
// storageObject.appendChild(Translator.makePersistentTranslation("storage-info", [
|
||||
// Math.round(storage.usage / (1024 * 1024) * 100) / 100,
|
||||
// Math.round(storage.quota / (1024 * 1024) * 100) / 100,
|
||||
// Math.round(storage.usage / storage.quota * 10000) / 100,
|
||||
// ((isPersisted) ? "" : "nicht")]));
|
||||
// storageObject.parentElement.classList.remove("hidden");
|
||||
// storageObject.parentElement.addEventListener("click", () => {
|
||||
// storageManager.persist().then(isPersisted => {
|
||||
// storageObject.removeAllChildren().appendChild(Translator.makePersistentTranslation("storage-info", [
|
||||
// Math.round(storage.usage / (1024 * 1024) * 100) / 100,
|
||||
// Math.round(storage.quota / (1024 * 1024) * 100) / 100,
|
||||
// Math.round(storage.usage / storage.quota * 10000) / 100,
|
||||
// ((isPersisted) ? "" : "nicht")]));
|
||||
//
|
||||
// console.log("p", isPersisted);
|
||||
// if (!isPersisted){
|
||||
// FlashMessenger.addMessage("storage-permission-not-get");
|
||||
// }
|
||||
// else {
|
||||
// FlashMessenger.addMessage("storage-permission-get");
|
||||
// }
|
||||
// });
|
||||
// })
|
||||
// });
|
||||
// }
|
||||
let storageManager = MyStorageManager.getInstance();
|
||||
if (storageManager.canEstimateStorage()) {
|
||||
console.log("can estimate storage!");
|
||||
Promise.all([storageManager.estimate(), storageManager.isPersistent()]).then(res => {
|
||||
let storage = res[0];
|
||||
let isPersisted = res[1];
|
||||
let storageObject = this.findBy("#storage-info");
|
||||
console.log(isPersisted);
|
||||
storageObject.appendChild(Translator.makePersistentTranslation("storage-info", [
|
||||
Math.round(storage.usage / (1024 * 1024) * 100) / 100,
|
||||
Math.round(storage.quota / (1024 * 1024) * 100) / 100,
|
||||
Math.round(storage.usage / storage.quota * 10000) / 100,
|
||||
((isPersisted) ? "" : "nicht")]));
|
||||
storageObject.parentElement.classList.remove("hidden");
|
||||
storageObject.parentElement.addEventListener("click", () => {
|
||||
storageManager.persist().then(isPersisted => {
|
||||
storageObject.removeAllChildren().appendChild(Translator.makePersistentTranslation("storage-info", [
|
||||
Math.round(storage.usage / (1024 * 1024) * 100) / 100,
|
||||
Math.round(storage.quota / (1024 * 1024) * 100) / 100,
|
||||
Math.round(storage.usage / storage.quota * 10000) / 100,
|
||||
((isPersisted) ? "" : "nicht")]));
|
||||
|
||||
console.log("p", isPersisted);
|
||||
if (!isPersisted){
|
||||
FlashMessenger.addMessage("storage-permission-not-get");
|
||||
}
|
||||
else {
|
||||
FlashMessenger.addMessage("storage-permission-get");
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
return super.onFirstStart();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user