This commit is contained in:
张成
2025-12-03 18:26:28 +08:00
parent 828a090daa
commit 7699facccd
4 changed files with 37 additions and 27 deletions

View File

@@ -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}
/>
)) || []}