diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index d074416..98af06a 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -37,7 +37,26 @@ export default function ChatFragment({ target, ...props }: Args) { setChatInfo(re.data as Chat) }, [target]) - console.log(tabItemSelected) + let page = 0 + async function loadMore() { + const re = await Client.invoke("Chat.getMessageHistory", { + token: data.access_token, + target, + page, + }) + + if (checkApiSuccessOrSncakbar(re, "拉取歷史記錄失敗")) return + page++ + setMessagesList(messagesList.concat()) + } + + React.useEffect(() => { + + return () => { + + } + }) + return (