Fix loading of older messages in message history #56

Merged
sauceyred merged 6 commits from fix/old-messages-loading into main 2025-08-03 18:07:47 +00:00
Showing only changes of commit 4e60139ac2 - Show all commits

View file

@ -237,12 +237,8 @@ function sendMessage(e: Event) {
} }
function getReplyMessage(id: string) { function getReplyMessage(id: string) {
console.log("[REPLYMSG] id:", id);
const messagesValues = Object.values(messages.value); const messagesValues = Object.values(messages.value);
console.log("[REPLYMSG] messages values:", messagesValues);
for (const message of messagesValues) { for (const message of messagesValues) {
console.log("[REPLYMSG] message:", message);
console.log("[REPLYMSG] IDs match?", message.uuid == id);
if (message.uuid == id) return message; if (message.uuid == id) return message;
} }
} }
@ -266,7 +262,6 @@ onMounted(async () => {
if (fetched) return; if (fetched) return;
fetched = true; fetched = true;
console.log("scroll height is at 10% or less"); console.log("scroll height is at 10% or less");
//console.log("current oldest:", currentOldestMessage);
const olderMessages = await fetchMessages(route.params.channelId as string, { amount, offset }); const olderMessages = await fetchMessages(route.params.channelId as string, { amount, offset });
if (olderMessages?.length) { if (olderMessages?.length) {
olderMessages.reverse(); olderMessages.reverse();