diff --git a/dev/Stores/User/Message.js b/dev/Stores/User/Message.js index b42093e2d..222da55ba 100644 --- a/dev/Stores/User/Message.js +++ b/dev/Stores/User/Message.js @@ -82,10 +82,8 @@ export const MessageUserStore = new class { listPageBeforeThread: 1, listError: '', - listEndFolder: '', - listEndSearch: '', + listEndHash: '', listEndThreadUid: 0, - listEndPage: 1, listLoading: false, // Happens when message(s) removed from list @@ -120,15 +118,6 @@ export const MessageUserStore = new class { return value; }, */ - listEndHash: () => - this.listEndFolder() + - '|' + - this.listEndSearch() + - '|' + - this.listEndThreadUid() + - '|' + - this.listEndPage(), - listPageCount: () => Math.max(1, Math.ceil(this.listCount() / SettingsUserStore.messagesPerPage())), mainMessageListSearch: { @@ -199,13 +188,6 @@ export const MessageUserStore = new class { } }, - listEndFolder: folder => { - const message = this.message(); - if (message && folder && folder !== message.folder) { - this.message(null); - } - }, - isMessageSelected: value => elementById('rl-right').classList.toggle('message-selected', value) }); @@ -658,12 +640,19 @@ export const MessageUserStore = new class { this.listCount(collection.MessageResultCount); this.listSearch(pString(collection.Search)); this.listPage(Math.ceil(collection.Offset / SettingsUserStore.messagesPerPage() + 1)); - this.listThreadUid(data.Result.ThreadUid); + this.listThreadUid(collection.ThreadUid); - this.listEndFolder(collection.Folder); - this.listEndSearch(this.listSearch()); - this.listEndThreadUid(this.listThreadUid()); - this.listEndPage(this.listPage()); + this.listEndHash( + collection.Folder + + '|' + collection.Search + + '|' + this.listThreadUid() + + '|' + this.listPage() + ); + this.listEndThreadUid(collection.ThreadUid); + const message = this.message(); + if (message && collection.Folder !== message.folder) { + this.message(null); + } this.listDisableAutoSelect(true); diff --git a/dev/View/User/MailBox/MessageList.js b/dev/View/User/MailBox/MessageList.js index 747234992..bbec32fbe 100644 --- a/dev/View/User/MailBox/MessageList.js +++ b/dev/View/User/MailBox/MessageList.js @@ -80,7 +80,7 @@ export class MailMessageList extends AbstractViewRight { this.useCheckboxesInList = SettingsUserStore.useCheckboxesInList; - this.messageListEndThreadUid = MessageUserStore.listEndThreadUid; + this.messageListThreadUid = MessageUserStore.listEndThreadUid; this.messageListIsLoading = MessageUserStore.listIsLoading; @@ -115,7 +115,7 @@ export class MailMessageList extends AbstractViewRight { ), messageListSearchDesc: () => { - const value = MessageUserStore.listEndSearch(); + const value = MessageUserStore.list().Search; return value ? i18n('MESSAGE_LIST/SEARCH_RESULT_FOR', { SEARCH: value }) : '' }, @@ -142,17 +142,17 @@ export class MailMessageList extends AbstractViewRight { hasMessages: () => 0 < MessageUserStore.list.length, - isSpamFolder: () => (FolderUserStore.spamFolder() || 0) === MessageUserStore.listEndFolder(), + isSpamFolder: () => (FolderUserStore.spamFolder() || 0) === MessageUserStore.list().Folder, isSpamDisabled: () => UNUSED_OPTION_VALUE === FolderUserStore.spamFolder(), - isTrashFolder: () => (FolderUserStore.trashFolder() || 0) === MessageUserStore.listEndFolder(), + isTrashFolder: () => (FolderUserStore.trashFolder() || 0) === MessageUserStore.list().Folder, - isDraftFolder: () => (FolderUserStore.draftsFolder() || 0) === MessageUserStore.listEndFolder(), + isDraftFolder: () => (FolderUserStore.draftsFolder() || 0) === MessageUserStore.list().Folder, - isSentFolder: () => (FolderUserStore.sentFolder() || 0) === MessageUserStore.listEndFolder(), + isSentFolder: () => (FolderUserStore.sentFolder() || 0) === MessageUserStore.list().Folder, - isArchiveFolder: () => (FolderUserStore.archiveFolder() || 0) === MessageUserStore.listEndFolder(), + isArchiveFolder: () => (FolderUserStore.archiveFolder() || 0) === MessageUserStore.list().Folder, isArchiveDisabled: () => UNUSED_OPTION_VALUE === FolderUserStore.archiveFolder(), diff --git a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html index 98700ef7e..ff86fe3a3 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html @@ -163,7 +163,7 @@