From 70093e4d23965fdbb5fc562ae58b4bb263b7d680 Mon Sep 17 00:00:00 2001 From: djmaze <> Date: Wed, 5 Jan 2022 11:46:08 +0100 Subject: [PATCH] move 3 Subscribables into single Computable --- dev/Stores/User/Message.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dev/Stores/User/Message.js b/dev/Stores/User/Message.js index 6c0cf90e2..5388e91f9 100644 --- a/dev/Stores/User/Message.js +++ b/dev/Stores/User/Message.js @@ -89,8 +89,6 @@ export const MessageUserStore = new class { listLoading: false, // Happens when message(s) removed from list listIsIncomplete: false, - // when this.listLoading || this.listIsIncomplete - listIsLoading: false, selectorMessageSelected: null, selectorMessageFocused: null, @@ -112,13 +110,12 @@ export const MessageUserStore = new class { // Computed Observables addComputablesTo(this, { -/* listIsLoading: () => { const value = this.listLoading() | this.listIsIncomplete(); $htmlCL.toggle('list-loading', value); return value; }, -*/ + listPageCount: () => Math.max(1, Math.ceil(this.listCount() / SettingsUserStore.messagesPerPage())), mainMessageListSearch: { @@ -164,14 +161,6 @@ export const MessageUserStore = new class { // Subscribers addSubscribablesTo(this, { - listIsLoading: value => $htmlCL.toggle('list-loading', value), - - listLoading: value => - this.listIsLoading(value || this.listIsIncomplete()), - - listIsIncomplete: value => - this.listIsLoading(value || this.listLoading()), - message: message => { clearTimeout(MessageSeenTimer); if (message) {