mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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
|
|
@ -210,8 +210,8 @@ export class MessageFlagsCache
|
|||
}
|
||||
}
|
||||
|
||||
if (message.threads().length) {
|
||||
const unseenSubUid = message.threads().find(sSubUid => {
|
||||
if (message.threads.length) {
|
||||
const unseenSubUid = message.threads.find(sSubUid => {
|
||||
if (uid !== sSubUid) {
|
||||
const subFlags = this.getFor(message.folder, sSubUid);
|
||||
return subFlags && subFlags.length && !!subFlags[0];
|
||||
|
|
@ -219,7 +219,7 @@ export class MessageFlagsCache
|
|||
return false;
|
||||
});
|
||||
|
||||
const flaggedSubUid = message.threads().find(sSubUid => {
|
||||
const flaggedSubUid = message.threads.find(sSubUid => {
|
||||
if (uid !== sSubUid) {
|
||||
const subFlags = this.getFor(message.folder, sSubUid);
|
||||
return subFlags && subFlags.length && !!subFlags[1];
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class Selector {
|
|||
) {
|
||||
this.list = koList;
|
||||
|
||||
this.listChecked = ko.computed(() => this.list().filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||
this.listChecked = ko.computed(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||
this.isListChecked = ko.computed(() => 0 < this.listChecked().length);
|
||||
|
||||
this.focusedItem = koFocusedItem || ko.observable(null);
|
||||
|
|
@ -329,11 +329,11 @@ class Selector {
|
|||
result = null;
|
||||
|
||||
const pageStep = 10,
|
||||
list = this.list(),
|
||||
listLen = list ? list.length : 0,
|
||||
list = this.list,
|
||||
listLen = list.length,
|
||||
focused = this.focusedItem();
|
||||
|
||||
if (0 < listLen) {
|
||||
if (listLen) {
|
||||
if (focused) {
|
||||
if (isArrow) {
|
||||
let i = list.indexOf(focused);
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ export function folderListOptionsBuilder(
|
|||
}
|
||||
}
|
||||
|
||||
if (oItem.subscribed() && oItem.subFolders().length) {
|
||||
if (oItem.subscribed() && oItem.subFolders.length) {
|
||||
aResult = aResult.concat(
|
||||
folderListOptionsBuilder(
|
||||
[],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue