local const 得到的 chatInfo 而不是使用旧的 state
This commit is contained in:
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user