mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Replaced tricky delegateRunOnDestroy() with koArrayWithDestroy()
koArrayWithDestroy creates ko.observableArray and calls the desired onDestroy() on entry delete.
This commit is contained in:
parent
f4bc796fb1
commit
e324e2f6b6
13 changed files with 32 additions and 55 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import ko from 'ko';
|
||||
import { koArrayWithDestroy } from 'External/ko';
|
||||
|
||||
import { arrayLength, pString } from 'Common/Utils';
|
||||
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
||||
import { i18n } from 'Common/Translator';
|
||||
import { getFolderFromCacheList } from 'Common/Cache';
|
||||
|
||||
|
|
@ -65,7 +64,7 @@ export class FilterModel extends AbstractModel {
|
|||
actionType: FilterAction.MoveTo
|
||||
});
|
||||
|
||||
this.conditions = ko.observableArray();
|
||||
this.conditions = koArrayWithDestroy();
|
||||
|
||||
const fGetRealFolderName = (folderFullName) => {
|
||||
const folder = getFolderFromCacheList(folderFullName);
|
||||
|
|
@ -211,7 +210,6 @@ export class FilterModel extends AbstractModel {
|
|||
|
||||
removeCondition(oConditionToDelete) {
|
||||
this.conditions.remove(oConditionToDelete);
|
||||
delegateRunOnDestroy(oConditionToDelete);
|
||||
}
|
||||
|
||||
setRecipients() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue