mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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,7 @@
|
|||
import 'External/User/ko';
|
||||
|
||||
import { isArray, arrayLength, pString, forEachObjectValue } from 'Common/Utils';
|
||||
import { delegateRunOnDestroy, mailToHelper, setLayoutResizer } from 'Common/UtilsUser';
|
||||
import { mailToHelper, setLayoutResizer } from 'Common/UtilsUser';
|
||||
|
||||
import {
|
||||
Notification,
|
||||
|
|
@ -333,8 +333,6 @@ class AppUser extends AbstractApp {
|
|||
if (isArray(accounts)) {
|
||||
// AccountUserStore.accounts.forEach(oAccount => counts[oAccount.email] = oAccount.count());
|
||||
|
||||
delegateRunOnDestroy(AccountUserStore.accounts());
|
||||
|
||||
AccountUserStore.accounts(
|
||||
accounts.map(
|
||||
sValue => new AccountModel(sValue/*, counts[sValue]*/)
|
||||
|
|
@ -345,8 +343,6 @@ class AppUser extends AbstractApp {
|
|||
}
|
||||
|
||||
if (isArray(oData.Result.Identities)) {
|
||||
delegateRunOnDestroy(IdentityUserStore());
|
||||
|
||||
IdentityUserStore(
|
||||
oData.Result.Identities.map(identityData => {
|
||||
const identity = new IdentityModel(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue