Improved observables

This commit is contained in:
djmaze 2020-10-27 11:09:24 +01:00
parent 8d7e25fc7c
commit 7db7d5545b
28 changed files with 236 additions and 234 deletions

View file

@ -3,17 +3,19 @@ import { Capa } from 'Common/Enums';
class CapaAdminStore {
constructor() {
this.additionalAccounts = ko.observable(false);
this.identities = ko.observable(false);
this.attachmentThumbnails = ko.observable(false);
this.sieve = ko.observable(false);
this.filters = ko.observable(false);
this.themes = ko.observable(true);
this.userBackground = ko.observable(false);
this.openPGP = ko.observable(false);
this.twoFactorAuth = ko.observable(false);
this.twoFactorAuthForce = ko.observable(false);
this.templates = ko.observable(false);
ko.addObservablesTo(this, {
additionalAccounts: false,
identities: false,
attachmentThumbnails: false,
sieve: false,
filters: false,
themes: true,
userBackground: false,
openPGP: false,
twoFactorAuth: false,
twoFactorAuthForce: false,
templates: false
});
}
populate() {

View file

@ -1,15 +0,0 @@
import ko from 'ko';
class LicenseAdminStore {
constructor() {
this.licensing = ko.observable(false);
this.licensingProcess = ko.observable(false);
this.licenseValid = ko.observable(false);
this.licenseExpired = ko.observable(0);
this.licenseError = ko.observable('');
this.licenseTrigger = ko.observable(false);
}
}
export default new LicenseAdminStore();

View file

@ -5,8 +5,10 @@ class PackageAdminStore {
this.packages = ko.observableArray([]);
this.packages.loading = ko.observable(false).extend({ throttle: 100 });
this.packagesReal = ko.observable(true);
this.packagesMainUpdatable = ko.observable(true);
ko.addObservablesTo(this, {
packagesReal: true,
packagesMainUpdatable: true
});
}
}