1
This commit is contained in:
@@ -183,6 +183,20 @@ const FollowPage: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 处理屏蔽成功
|
||||
const handle_block_success = (user_id: number) => {
|
||||
// 从当前列表中移除被屏蔽的用户
|
||||
set_user_lists(prev => {
|
||||
const new_lists = { ...prev };
|
||||
if (new_lists[active_tab] && Array.isArray(new_lists[active_tab])) {
|
||||
new_lists[active_tab] = new_lists[active_tab].filter(user => user.id !== user_id);
|
||||
}
|
||||
return new_lists;
|
||||
});
|
||||
// 重新加载当前标签页的列表
|
||||
load_user_list(active_tab, true);
|
||||
};
|
||||
|
||||
// 初始化加载
|
||||
useEffect(() => {
|
||||
try {
|
||||
@@ -293,6 +307,7 @@ const FollowPage: React.FC = () => {
|
||||
user={user}
|
||||
tabKey={active_tab}
|
||||
onFollowChange={handle_follow_change}
|
||||
onBlockSuccess={handle_block_success}
|
||||
/>
|
||||
)) || []}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user