只有不是对话成员时才不会加载消息呢
This commit is contained in:
@@ -85,6 +85,7 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC
|
|||||||
const chatInfo = re.data as Chat
|
const chatInfo = re.data as Chat
|
||||||
setChatInfo(chatInfo)
|
setChatInfo(chatInfo)
|
||||||
|
|
||||||
|
if (chatInfo.is_member)
|
||||||
await loadMore()
|
await loadMore()
|
||||||
|
|
||||||
setTabItemSelected(chatInfo.is_member ? "Chat" : "RequestJoin")
|
setTabItemSelected(chatInfo.is_member ? "Chat" : "RequestJoin")
|
||||||
@@ -272,6 +273,7 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC
|
|||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
}} onScroll={async (e) => {
|
}} onScroll={async (e) => {
|
||||||
|
if (!chatInfo.is_member) return
|
||||||
const scrollTop = (e.target as HTMLDivElement).scrollTop
|
const scrollTop = (e.target as HTMLDivElement).scrollTop
|
||||||
if (scrollTop == 0 && !showLoadingMoreMessagesTip) {
|
if (scrollTop == 0 && !showLoadingMoreMessagesTip) {
|
||||||
setShowLoadingMoreMessagesTip(true)
|
setShowLoadingMoreMessagesTip(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user