mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-13 10:54:28 +08:00
scroll after filling
This commit is contained in:
parent
864de4cbe1
commit
e5aff03620
3 changed files with 7 additions and 7 deletions
|
|
@ -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 () => {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue