refactor(database): migrate to new modular database layer and unify data access
- Remove legacy database.ts, LocalDataSource.ts, and MessageRepository.ts - Create new src/database/ module with messageRepository, userCacheRepository, conversationRepository, and groupCacheRepository - Update all consumers to import from @/database instead of services/database - Add web platform blur handling for modal components to fix focus issues - Flatten SystemMessageItem and NotificationsScreen styles for consistent design - Add draggable slider in ChatSettingsScreen and dynamic font size support - Introduce 9 new chat color themes - Add profile screens for about, terms, and privacy policy with navigation routes - Add policy links to login and registration screens - Fix post share URL format from /posts/ to /post/
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
CursorPaginationRequest,
|
||||
} from '../types/dto';
|
||||
import { groupService } from '../services/groupService';
|
||||
import { getAllGroupsCache, getGroupMembersCache } from '../services/database';
|
||||
import { groupCacheRepository } from '@/database';
|
||||
|
||||
export const GROUP_LIST_PAGE_SIZE = 20;
|
||||
export const GROUP_MEMBER_LIST_PAGE_SIZE = 50;
|
||||
@@ -130,7 +130,7 @@ export class SqliteGroupListPagedSource implements IGroupListPagedSource {
|
||||
}
|
||||
this.consumed = true;
|
||||
try {
|
||||
const items = await getAllGroupsCache();
|
||||
const items = await groupCacheRepository.getAll();
|
||||
return { items, hasMore: false };
|
||||
} catch (e) {
|
||||
console.warn('[SqliteGroupListPagedSource] 读取群组列表缓存失败:', e);
|
||||
@@ -265,7 +265,7 @@ export class SqliteGroupMemberListPagedSource implements IGroupMemberListPagedSo
|
||||
}
|
||||
this.consumed = true;
|
||||
try {
|
||||
const items = await getGroupMembersCache(this.groupId);
|
||||
const items = await groupCacheRepository.getMembers(this.groupId);
|
||||
return { items, hasMore: false };
|
||||
} catch (e) {
|
||||
console.warn('[SqliteGroupMemberListPagedSource] 读取成员列表缓存失败:', e);
|
||||
|
||||
Reference in New Issue
Block a user