feat(ui): add emoji picker with FlatList virtualization and improve input components
- Add full emoji picker with virtualized FlatList to CreatePostScreen and PostDetailScreen - Add autoExpand prop to PostMentionInput for XHS-style content area - Improve mention item styling with @ icon and hint text - Fix HomeScreen tab switching race condition with requestAnimationFrame - Fix PostRepository pagination to prefer cursor over page parameter - Fix user store imports to use explicit UserManager path - Refactor useCurrentUser hook to use sessionStore directly
This commit is contained in:
@@ -439,8 +439,18 @@ export const HomeScreen: React.FC = () => {
|
||||
|
||||
// Tab 切换时刷新数据并重置列表
|
||||
useEffect(() => {
|
||||
reset();
|
||||
refresh();
|
||||
let cancelled = false;
|
||||
const run = async () => {
|
||||
reset();
|
||||
// reset 会清空 store 中的状态,但异步订阅可能有延迟;
|
||||
// 等一帧确保 store 的订阅回调已传播到 useDifferentialPosts
|
||||
await new Promise(resolve => requestAnimationFrame(resolve));
|
||||
if (!cancelled) {
|
||||
await refresh();
|
||||
}
|
||||
};
|
||||
run();
|
||||
return () => { cancelled = true; };
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [activeIndex, currentChannelId]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user