fix:[FL-16][修复卡片视图初始渲染问题]

修复卡片视图模式下,页面初次加载时接口返回数据但页面不渲染的问题。

问题原因:重置效果的条件判断(viewMode === "card")导致在表格视图模式下切换过滤条件时不会重置状态,当切回卡片视图时会使用旧的状态数据。

解决方案:移除 viewMode 的条件判断,确保无论当前视图模式如何,过滤条件变化时都会正确重置卡片视图状态。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
chengkai3
2026-06-19 13:37:56 +08:00
parent 31b686543d
commit ad02f9eb3a
+3 -5
View File
@@ -656,11 +656,9 @@ export default function AdminUsersPage() {
// Reset card view state when switching modes or filters change
useEffect(() => {
if (viewMode === "card") {
setCardViewPage(1);
setAllLoadedUsers([]);
}
}, [viewMode, statusFilter, trimmedKeyword]);
setCardViewPage(1);
setAllLoadedUsers([]);
}, [statusFilter, trimmedKeyword]);
const updateTableScrollY = useCallback(() => {
if (typeof window === "undefined") {