mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Cleanup calls to Knockout observableArray
Improved Knockout observableArray
This commit is contained in:
parent
fa5476e486
commit
b6f0b634fb
47 changed files with 251 additions and 276 deletions
|
|
@ -46,7 +46,7 @@ class FilterModel extends AbstractModel {
|
|||
actionType: FiltersAction.MoveTo
|
||||
});
|
||||
|
||||
this.conditions = ko.observableArray([]);
|
||||
this.conditions = ko.observableArray();
|
||||
|
||||
const fGetRealFolderName = (folderFullNameRaw) => {
|
||||
const folder = getFolderFromCacheList(folderFullNameRaw);
|
||||
|
|
@ -137,7 +137,7 @@ class FilterModel extends AbstractModel {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (this.conditions().length && this.conditions().find(cond => cond && !cond.verify())) {
|
||||
if (this.conditions.length && this.conditions.find(cond => cond && !cond.verify())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ class FilterModel extends AbstractModel {
|
|||
ID: this.id,
|
||||
Enabled: this.enabled() ? '1' : '0',
|
||||
Name: this.name(),
|
||||
Conditions: this.conditions().map(item => item.toJson()),
|
||||
Conditions: this.conditions.map(item => item.toJson()),
|
||||
ConditionsType: this.conditionsType(),
|
||||
|
||||
ActionType: this.actionType(),
|
||||
|
|
@ -259,7 +259,7 @@ class FilterModel extends AbstractModel {
|
|||
filter.actionKeep(this.actionKeep());
|
||||
filter.actionNoStop(this.actionNoStop());
|
||||
|
||||
filter.conditions(this.conditions().map(item => item.cloneSelf()));
|
||||
filter.conditions(this.conditions.map(item => item.cloneSelf()));
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue