Remove messagelist UpOrDown delay

This commit is contained in:
the-djmaze 2023-10-08 14:03:32 +02:00
parent 231ccb1e43
commit 59f9ccdbdc

View file

@ -71,7 +71,6 @@ const
Ymd = dt => dt.getFullYear() + pad2(1 + dt.getMonth()) + pad2(dt.getDate()); Ymd = dt => dt.getFullYear() + pad2(1 + dt.getMonth()) + pad2(dt.getDate());
let let
iGoToUpOrDownTimeout = 0,
sLastSearchValue = ''; sLastSearchValue = '';
export class MailMessageList extends AbstractViewRight { export class MailMessageList extends AbstractViewRight {
@ -257,20 +256,17 @@ export class MailMessageList extends AbstractViewRight {
this.selector.on('UpOrDown', up => { this.selector.on('UpOrDown', up => {
if (!MessagelistUserStore.hasChecked()) { if (!MessagelistUserStore.hasChecked()) {
clearTimeout(iGoToUpOrDownTimeout); let page = MessagelistUserStore.page();
iGoToUpOrDownTimeout = setTimeout(() => { up ? --page : ++page;
let page = MessagelistUserStore.page(); if (page > 0 && page <= MessagelistUserStore.pageCount()) {
up ? --page : ++page; if (SettingsUserStore.usePreviewPane() || MessageUserStore.message()) {
if (page > 0 && page <= MessagelistUserStore.pageCount()) { this.selector.iSelectNextHelper = up ? -1 : 1;
if (SettingsUserStore.usePreviewPane() || MessageUserStore.message()) { } else {
this.selector.iSelectNextHelper = up ? -1 : 1; this.selector.iFocusedNextHelper = up ? -1 : 1;
} else {
this.selector.iFocusedNextHelper = up ? -1 : 1;
}
this.selector.unselect();
this.gotoPage(page);
} }
}, 350); this.selector.unselect();
this.gotoPage(page);
}
} }
}); });