refactor: migrate post operations to use case architecture with differential updates
Migrate post-related operations from direct service/store calls to a new use case architecture featuring differential updates. Key changes include: (1) introduce ProcessPostUseCase to handle like, unlike, favorite, unfavorite, delete, and fetch operations with proper state management, (2) add useDifferentialPosts hook for efficient list rendering with minimal re-renders, (3) add PostDiffCalculator and PostUpdateBatcher in infrastructure layer for incremental updates, (4) deprecate NotificationItem component in favor of SystemMessageItem, (5) remove deprecated interactive methods from userStore, (6) add posts_cache table to local datasource, (7) clean up legacy MessageDTO and ConversationDTO types, (8) remove deprecated hook useBreakpointCheck, (9) refactor MessageBubble to use measureInWindow directly for better React Native compatibility
This commit is contained in:
@@ -502,10 +502,9 @@ interface UseMessageListRefreshReturn {
|
||||
* 从 ChatScreen 返回时,MessageManager 内存状态已经是最新的(markAsRead 乐观更新),
|
||||
* 无需再请求服务器(避免时序竞争覆盖已读状态)。
|
||||
* 仅在用户主动下拉刷新时才触发服务器请求。
|
||||
* @deprecated isFocused 参数保留仅为向后兼容,不再触发焦点刷新
|
||||
* 注意:isFocused 参数已移除,不再触发焦点刷新
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export function useMessageListRefresh(_isFocused?: boolean): UseMessageListRefreshReturn {
|
||||
export function useMessageListRefresh(): UseMessageListRefreshReturn {
|
||||
const [isRefreshing, setIsRefreshing] = useState(false);
|
||||
const lastRefreshTimeRef = useRef<number>(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user