refactor(PostCard, PostCard.legacy): remove legacy PostCard component and update exports
- Deleted the legacy PostCard component to streamline the codebase and improve maintainability. - Updated exports in PostCard and index files to remove references to the legacy component. - Adjusted PostCardProps to eliminate legacy properties, ensuring only the new API is supported. - Enhanced the PostCard component to focus on modern implementation and features.
This commit is contained in:
@@ -55,7 +55,10 @@ export function useConversations(): UseConversationsReturn {
|
||||
|
||||
// 冷启动兜底:延迟做一次强制刷新,避免首次因时序问题拿到空列表
|
||||
const coldStartSyncTimer = setTimeout(() => {
|
||||
messageManager.fetchConversations(true).catch(error => {
|
||||
messageManager.requestConversationListRefresh('hooks-initial-refresh', {
|
||||
force: true,
|
||||
allowDefer: true,
|
||||
}).catch(error => {
|
||||
console.error('[useConversations] 冷启动强制刷新失败:', error);
|
||||
});
|
||||
}, 1200);
|
||||
@@ -67,7 +70,10 @@ export function useConversations(): UseConversationsReturn {
|
||||
}, []);
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
await messageManager.fetchConversations(true);
|
||||
await messageManager.requestConversationListRefresh('hooks-manual-refresh', {
|
||||
force: true,
|
||||
allowDefer: false,
|
||||
});
|
||||
}, []);
|
||||
|
||||
const loadMore = useCallback(async () => {
|
||||
@@ -530,7 +536,10 @@ export function useMessageListRefresh(): UseMessageListRefreshReturn {
|
||||
|
||||
setIsRefreshing(true);
|
||||
try {
|
||||
await messageManager.fetchConversations(true);
|
||||
await messageManager.requestConversationListRefresh('hooks-load-more-fallback', {
|
||||
force: true,
|
||||
allowDefer: false,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('[useMessageListRefresh] 刷新失败:', error);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user