pl-fe: allow accessing 'load more' button with hotkeys

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-10-31 11:02:41 +01:00
parent 83d2bc1073
commit e1986fb670
11 changed files with 25 additions and 14 deletions

View File

@@ -29,7 +29,7 @@ const ConversationsList: React.FC = () => {
const handleMoveDown = (id: string) => {
const elementIndex = getCurrentIndex(id) + 1;
selectChild(elementIndex, ref, document.getElementById('direct-list') || undefined);
selectChild(elementIndex, ref, document.getElementById('direct-list') || undefined, conversations.length);
};
const handleLoadOlder = debounce(() => {

View File

@@ -254,15 +254,15 @@ const Thread = ({
const handleMoveDown = (id: string) => {
const modalOffset = isModal ? 1 : 0;
if (id === status.id) {
selectChild(statusIndex + 1 + modalOffset, scroller, node.current || undefined);
selectChild(statusIndex + 1 + modalOffset, scroller, node.current || undefined, thread.length + modalOffset);
} else {
let index = thread.indexOf(id);
if (index === -1) {
index = thread.indexOf(id);
selectChild(index + modalOffset, scroller, node.current || undefined);
selectChild(index + modalOffset, scroller, node.current || undefined, thread.length + modalOffset);
} else {
selectChild(index + 1 + modalOffset, scroller, node.current || undefined);
selectChild(index + 1 + modalOffset, scroller, node.current || undefined, thread.length + modalOffset);
}
}
};