chore: update styles, add splash config, and improve search functionality
All checks were successful
Frontend CI / ota-android (push) Successful in 1m50s
Frontend CI / ota-ios (push) Successful in 2m38s
Frontend CI / build-and-push-web (push) Successful in 10m12s
Frontend CI / build-android-apk (push) Successful in 17m46s

- Replace deprecated StyleSheet.absoluteFillObject with StyleSheet.absoluteFill (React Native 0.76+)
- Add splash screen configuration in app.json
- Fix duplicate UIBackgroundModes and add audio mode for iOS
- Disable Android ripple effect on tab bar buttons
- Improve SmartImage loading state to prevent unnecessary re-renders
- Refactor ImageGrid to use mainUri with separate previewUrl for better preview handling
- Add market search support with trade items tab in SearchScreen
- Pass homeTab prop to SearchScreen for context-aware search behavior
- Simplify fetchUnreadCount return type to void in MessageSyncService
- Fix StatusBar import from expo to react-native in ChatScreen
This commit is contained in:
lafay
2026-06-02 08:14:04 +08:00
parent 52d2581dda
commit 8ee6e77cb4
24 changed files with 156 additions and 59 deletions

View File

@@ -208,7 +208,7 @@ class MessageManager {
return this.syncService.loadMoreMessages(conversationId, beforeSeq, limit);
}
async fetchUnreadCount(): Promise<{ totalUnread: number; systemUnread: number }> {
async fetchUnreadCount(): Promise<void> {
return this.syncService.fetchUnreadCount();
}

View File

@@ -30,7 +30,7 @@ export class MessageSyncService implements IMessageSyncService {
/** 正在加载会话列表下一页 */
private loadingMoreConversations = false;
/** fetchUnreadCount 去重:复用 in-flight promise */
private fetchUnreadCountPromise: Promise<{ totalUnread: number; systemUnread: number }> | null = null;
private fetchUnreadCountPromise: Promise<void> | null = null;
constructor(
getCurrentUserId: () => string | null,
@@ -352,20 +352,19 @@ export class MessageSyncService implements IMessageSyncService {
/**
* 获取未读数(去重:复用 in-flight promise
*/
async fetchUnreadCount(): Promise<{ totalUnread: number; systemUnread: number }> {
async fetchUnreadCount(): Promise<void> {
if (this.fetchUnreadCountPromise) {
return this.fetchUnreadCountPromise;
}
this.fetchUnreadCountPromise = this.doFetchUnreadCount();
try {
const result = await this.fetchUnreadCountPromise;
return result;
await this.fetchUnreadCountPromise;
} finally {
this.fetchUnreadCountPromise = null;
}
}
private async doFetchUnreadCount(): Promise<{ totalUnread: number; systemUnread: number }> {
private async doFetchUnreadCount(): Promise<void> {
const store = useMessageStore.getState();
try {
@@ -393,10 +392,8 @@ export class MessageSyncService implements IMessageSyncService {
// 服务端汇总未读为 0不主动清零本地未读等 fetchConversations 提供权威数据
// 避免后端缓存竞态导致的未读数抖动
return { totalUnread, systemUnread };
} catch (error) {
console.error('[MessageSyncService] 获取未读数失败:', error);
return { totalUnread: 0, systemUnread: 0 };
}
}