mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Improved knockout observables management to prevent memory leaks
This commit is contained in:
parent
b165a1de4f
commit
3eb6ab1ef7
46 changed files with 1020 additions and 1013 deletions
|
|
@ -18,18 +18,18 @@ class DomainAliasPopupView extends AbstractViewNext {
|
|||
constructor() {
|
||||
super();
|
||||
|
||||
this.saving = ko.observable(false);
|
||||
this.savingError = ko.observable('');
|
||||
this.addObservables({
|
||||
saving: false,
|
||||
savingError: '',
|
||||
|
||||
this.name = ko.observable('');
|
||||
name: '',
|
||||
|
||||
this.alias = ko.observable('');
|
||||
alias: ''
|
||||
});
|
||||
|
||||
this.domains = DomainStore.domainsWithoutAliases;
|
||||
|
||||
this.domainsOptions = ko.computed(() =>
|
||||
this.domains().map(item => ({ optValue: item.name, optText: item.name }))
|
||||
);
|
||||
this.domainsOptions = ko.computed(() => this.domains().map(item => ({ optValue: item.name, optText: item.name })));
|
||||
|
||||
this.canBeSaved = ko.computed(() => !this.saving() && this.name() && this.alias());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue