Cleanup messagelist UpOrDown handling

This commit is contained in:
the-djmaze 2023-10-08 14:07:02 +02:00
parent 59f9ccdbdc
commit b3309f7b4e

View file

@ -256,13 +256,13 @@ export class MailMessageList extends AbstractViewRight {
this.selector.on('UpOrDown', up => { this.selector.on('UpOrDown', up => {
if (!MessagelistUserStore.hasChecked()) { if (!MessagelistUserStore.hasChecked()) {
let page = MessagelistUserStore.page(); up = up ? -1 : 1;
up ? --page : ++page; const page = MessagelistUserStore.page() + up;
if (page > 0 && page <= MessagelistUserStore.pageCount()) { if (page > 0 && page <= MessagelistUserStore.pageCount()) {
if (SettingsUserStore.usePreviewPane() || MessageUserStore.message()) { if (SettingsUserStore.usePreviewPane() || MessageUserStore.message()) {
this.selector.iSelectNextHelper = up ? -1 : 1; this.selector.iSelectNextHelper = up;
} else { } else {
this.selector.iFocusedNextHelper = up ? -1 : 1; this.selector.iFocusedNextHelper = up;
} }
this.selector.unselect(); this.selector.unselect();
this.gotoPage(page); this.gotoPage(page);