Skip to content

Commit c2e3640

Browse files
authored
Merge pull request #1626 from Shadow243/fix-refresh-with-pagination
fix(frontend): send correct page to Hm_MessagesStore while refreshing…
2 parents 9c48712 + a820576 commit c2e3640

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

modules/core/js_modules/actions/pagination.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function nextPage() {
2020

2121
const nextPage = parseInt(currentPage) + 1;
2222

23-
const store = new Hm_MessagesStore(getListPathParam(), currentPage, `${getParam('keyword')}_${getParam('filter')}`, getParam('sort'));
23+
const store = new Hm_MessagesStore(getListPathParam(), nextPage, `${getParam('keyword')}_${getParam('filter')}`, getParam('sort'));
2424
store.load(false, false, true);
2525

2626
await changePage(nextPage, this);
@@ -32,7 +32,7 @@ async function previousPage() {
3232
const previousPage = parseInt(currentPage) - 1;
3333

3434
if (previousPage > 1) {
35-
const store = new Hm_MessagesStore(getListPathParam(), previousPage - 1, `${getParam('keyword')}_${getParam('filter')}`, getParam('sort'));
35+
const store = new Hm_MessagesStore(getListPathParam(), previousPage, `${getParam('keyword')}_${getParam('filter')}`, getParam('sort'));
3636
store.load(false, false, true);
3737
}
3838

modules/desktop_notifications/site.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $(function() {
2222
// refresh the unread messages state
2323
setInterval(() => {
2424
// undefined_undefined: load with no filter and no keyword
25-
new Hm_MessagesStore('unread', 1, 'undefined_undefined').load(true, true).then((store) => {
25+
new Hm_MessagesStore('unread', getParam('list_page') || 1, 'undefined_undefined').load(true, true).then((store) => {
2626
store.newMessages.forEach((messageRow) => {
2727
triggerNewMessageEvent($(messageRow).data('uid'), $(messageRow)[0]);
2828
});

modules/imap/site.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ var setup_imap_folder_page = async function(listPath, listPage = 1) {
481481

482482
// Refresh in the background each 60 seconds
483483
const interval = setInterval(async () => {
484-
select_imap_folder(listPath, 1, true, true);
484+
select_imap_folder(listPath, getParam('list_page') || 1, true, true);
485485
}, 60000);
486486

487487
// Return cleanup function to clear interval when page unmounts

0 commit comments

Comments
 (0)