1
This commit is contained in:
@@ -64,11 +64,17 @@ const MessagePageContent: React.FC<MessagePageContentProps> = ({ isActive = true
|
||||
}
|
||||
};
|
||||
|
||||
// 只有当页面激活且未加载过数据时才加载接口
|
||||
// 当切换到消息 tab 时,调用红点信息接口
|
||||
useEffect(() => {
|
||||
if (isActive) {
|
||||
fetchReddotInfo();
|
||||
}
|
||||
}, [isActive]);
|
||||
|
||||
// 只有当页面激活且未加载过数据时才加载通知列表
|
||||
useEffect(() => {
|
||||
if (isActive && !hasLoaded) {
|
||||
getNoticeList();
|
||||
fetchReddotInfo();
|
||||
setHasLoaded(true);
|
||||
}
|
||||
}, [isActive, hasLoaded]);
|
||||
|
||||
Reference in New Issue
Block a user