Bugfix: conflicting File object with native JS

Cleanup: Stores and tooltips
This commit is contained in:
djmaze 2021-02-17 14:40:21 +01:00
parent 1df2e00862
commit db0d03db83
43 changed files with 204 additions and 295 deletions

View file

@ -3,7 +3,7 @@ import ko from 'ko';
import { Capa, StorageResultType } from 'Common/Enums';
import AccountStore from 'Stores/User/Account';
import IdentityStore from 'Stores/User/Identity';
import { IdentityUserStore } from 'Stores/User/Identity';
import Remote from 'Remote/User/Fetch';
import { showScreenPopup } from 'Knoin/Knoin';
@ -17,7 +17,7 @@ export class AccountsUserSettings {
this.allowIdentities = rl.settings.capa(Capa.Identities);
this.accounts = AccountStore.accounts;
this.identities = IdentityStore.identities;
this.identities = IdentityUserStore;
this.accountForDeletion = ko.observable(null).deleteAccessHelper();
this.identityForDeletion = ko.observable(null).deleteAccessHelper();
@ -72,14 +72,14 @@ export class AccountsUserSettings {
this.identityForDeletion(null);
if (identityToRemove) {
IdentityStore.identities.remove(oIdentity => identityToRemove === oIdentity);
IdentityUserStore.remove(oIdentity => identityToRemove === oIdentity);
Remote.identityDelete(() => rl.app.accountsAndIdentities(), identityToRemove.id());
}
}
}
accountsAndIdentitiesAfterMove() {
Remote.accountsAndIdentitiesSortOrder(null, AccountStore.getEmailAddresses(), IdentityStore.getIDS());
Remote.accountsAndIdentitiesSortOrder(null, AccountStore.getEmailAddresses(), IdentityUserStore.getIDS());
}
onBuild(oDom) {

View file

@ -4,7 +4,7 @@ import { delegateRunOnDestroy } from 'Common/UtilsUser';
import { StorageResultType, Notification } from 'Common/Enums';
import { getNotification } from 'Common/Translator';
import SieveStore from 'Stores/User/Sieve';
import { SieveUserStore } from 'Stores/User/Sieve';
import Remote from 'Remote/User/Fetch';
import { SieveScriptModel } from 'Model/SieveScript';
@ -15,7 +15,7 @@ import { SieveScriptPopupView } from 'View/Popup/SieveScript';
export class FiltersUserSettings {
constructor() {
this.scripts = SieveStore.scripts;
this.scripts = SieveUserStore.scripts;
this.loading = ko.observable(false).extend({ debounce: 200 });
ko.addObservablesTo(this, {
@ -41,7 +41,7 @@ export class FiltersUserSettings {
this.scripts([]);
if (StorageResultType.Success === result && data && data.Result) {
SieveStore.capa(data.Result.Capa);
SieveUserStore.capa(data.Result.Capa);
/*
this.scripts(
data.Result.Scripts.map(aItem => SieveScriptModel.reviveFromJson(aItem)).filter(v => v)
@ -52,7 +52,7 @@ export class FiltersUserSettings {
value && this.scripts.push(value)
});
} else {
SieveStore.capa([]);
SieveUserStore.capa([]);
this.setError(
data && data.ErrorCode ? getNotification(data.ErrorCode) : getNotification(Notification.CantGetFilters)
);

View file

@ -14,7 +14,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
import AppStore from 'Stores/User/App';
import { LanguageStore } from 'Stores/Language';
import SettingsStore from 'Stores/User/Settings';
import IdentityStore from 'Stores/User/Identity';
import { IdentityUserStore } from 'Stores/User/Identity';
import NotificationStore from 'Stores/User/Notification';
import MessageStore from 'Stores/User/Message';
@ -54,7 +54,7 @@ export class GeneralUserSettings {
layoutTrigger: SaveSettingsStep.Idle
});
this.identities = IdentityStore.identities;
this.identities = IdentityUserStore;
this.identityMain = ko.computed(() => {
const list = this.identities();

View file

@ -17,8 +17,8 @@ export class ThemesUserSettings {
this.themesObjects = ko.observableArray();
this.background = {};
this.background.name = ThemeStore.themeBackgroundName;
this.background.hash = ThemeStore.themeBackgroundHash;
this.background.name = ThemeStore.userBackgroundName;
this.background.hash = ThemeStore.userBackgroundHash;
this.background.uploaderButton = ko.observable(null);
this.background.loading = ko.observable(false);
this.background.error = ko.observable('');