local const 得到的 chatInfo 而不是使用旧的 state

This commit is contained in:
CrescentLeaf
2025-10-19 15:10:23 +08:00
parent 349e0933c3
commit 484381c6e5

View File

@@ -80,13 +80,14 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC
}) })
if (re.code != 200) if (re.code != 200)
return target != '' && checkApiSuccessOrSncakbar(re, "获取对话信息失败") return target != '' && checkApiSuccessOrSncakbar(re, "获取对话信息失败")
setChatInfo(re.data as Chat) const chatInfo = re.data as Chat
setChatInfo(chatInfo)
await loadMore() await loadMore()
setTabItemSelected("Chat") setTabItemSelected(chatInfo.is_member ? "Chat" : "RequestJoin")
if (re.data!.type == 'group') { if (re.data!.type == 'group') {
groupPreferenceStore.setState(re.data!.settings as GroupSettings) groupPreferenceStore.setState(chatInfo.settings as GroupSettings)
} }
setTimeout(() => { setTimeout(() => {
chatPanelRef.current!.scrollTo({ chatPanelRef.current!.scrollTo({