refactor(stores): unify data sources pattern and extract BaseManager base class
- Add BaseManager/CachedManager base classes to eliminate duplicate cache logic - Add postListSources.ts with IPostListPagedSource interface - Add groupListSources.ts with IGroupListPagedSource interface - Refactor postManager to use CachedManager and Sources pattern - Refactor groupManager to use CachedManager and Sources pattern - Clean up duplicate methods in groupService.ts - Fix TypeScript errors and remove mock data
This commit is contained in:
@@ -9,17 +9,10 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import { showConfirm } from './dialogService';
|
||||
|
||||
// 条件导入原生模块(仅在 Android 上可用)
|
||||
let FileSystem: typeof import('expo-file-system/legacy') | null = null;
|
||||
let IntentLauncher: typeof import('expo-intent-launcher') | null = null;
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
try {
|
||||
FileSystem = require('expo-file-system/legacy');
|
||||
IntentLauncher = require('expo-intent-launcher');
|
||||
} catch (e) {
|
||||
console.warn('Failed to load native modules for APK update:', e);
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const FileSystem = Platform.OS === 'android' ? require('expo-file-system/legacy') : null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const IntentLauncher = Platform.OS === 'android' ? require('expo-intent-launcher') : null;
|
||||
|
||||
// 更新服务器地址
|
||||
const UPDATES_SERVER_URL = Constants.expoConfig?.extra?.updatesUrl
|
||||
|
||||
Reference in New Issue
Block a user