scroll after filling

This commit is contained in:
Miodec 2026-01-03 21:52:49 +01:00
parent 864de4cbe1
commit e5aff03620
3 changed files with 7 additions and 7 deletions

View file

@ -24,10 +24,9 @@ export const page = new Page({
},
beforeShow: async () => {
if (TribeState.isInARoom()) {
TribeChat.fill("lobby");
setTimeout(() => {
void TribeChat.fill("lobby").then(() => {
TribeChat.scrollChat();
}, 50);
});
}
},
afterShow: async () => {

View file

@ -1149,8 +1149,9 @@ export async function update(
duration: Misc.applyReducedMotion(125),
});
TribeChat.scrollChat();
TribeChat.fill("result");
void TribeChat.fill("result").then(() => {
TribeChat.scrollChat();
});
const room = TribeState.getRoom();
if (room?.users) {

View file

@ -115,10 +115,10 @@ export function reset(where: "lobby" | "result"): void {
}
}
export function fill(where: "lobby" | "result"): void {
export async function fill(where: "lobby" | "result"): Promise<void> {
reset(where);
for (let i = 0; i < chatHistory.length; i++) {
void displayMessage(i, where);
await displayMessage(i, where);
}
}