summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/settings/storage-controller.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/ext/bg/js/settings/storage-controller.js b/ext/bg/js/settings/storage-controller.js
index 72d5a606..bc57017f 100644
--- a/ext/bg/js/settings/storage-controller.js
+++ b/ext/bg/js/settings/storage-controller.js
@@ -31,12 +31,12 @@ class StorageController {
prepare() {
this._persistentStorageCheckbox = document.querySelector('#storage-persistent-checkbox');
- this._storageUsageNode = document.querySelector('#storage-usage');
- this._storageQuotaNode = document.querySelector('#storage-quota');
- this._storageUseFiniteNodes = document.querySelectorAll('#storage-use-finite');
- this._storageUseInfiniteNodes = document.querySelectorAll('#storage-use-infinite');
- this._storageUseValidNodes = document.querySelectorAll('#storage-use-valid');
- this._storageUseInvalidNodes = document.querySelectorAll('#storage-use-invalid');
+ this._storageUsageNodes = document.querySelectorAll('.storage-usage');
+ this._storageQuotaNodes = document.querySelectorAll('.storage-quota');
+ this._storageUseFiniteNodes = document.querySelectorAll('.storage-use-finite');
+ this._storageUseInfiniteNodes = document.querySelectorAll('.storage-use-infinite');
+ this._storageUseValidNodes = document.querySelectorAll('.storage-use-valid');
+ this._storageUseInvalidNodes = document.querySelectorAll('.storage-use-invalid');
this._preparePersistentStorage();
this.updateStats();
@@ -56,8 +56,12 @@ class StorageController {
// Firefox reports usage as 0 when persistent storage is enabled.
const finite = valid && (estimate.usage > 0 || !(await this._isStoragePeristent()));
if (finite) {
- this._storageUsageNode.textContent = this._bytesToLabeledString(estimate.usage);
- this._storageQuotaNode.textContent = this._bytesToLabeledString(estimate.quota);
+ for (const node of this._storageUsageNodes) {
+ node.textContent = this._bytesToLabeledString(estimate.usage);
+ }
+ for (const node of this._storageQuotaNodes) {
+ node.textContent = this._bytesToLabeledString(estimate.quota);
+ }
}
this._setElementsVisible(this._storageUseFiniteNodes, valid && finite);