refactor(storage): 迁移 AsyncStorage 至 expo-sqlite/kv-store

- 统一替换所有 @react-native-async-storage/async-storage 导入为自定义 kvStore
- 新增 kvStore.ts 封装 expo-sqlite/kv-store,保持与 AsyncStorage 完全兼容
- 新增同步读写方法,提升性能
- 引入 expo-sqlite 依赖并更新 lock 文件

BREAKING CHANGE: 移除 @react-native-async-storage/async-storage 依赖,需重新安装依赖并清理旧数据
This commit is contained in:
richarjiang
2025-09-15 12:51:18 +08:00
parent 91df01bd79
commit 2357596665
20 changed files with 68 additions and 17 deletions

View File

@@ -670,7 +670,7 @@ export class WaterNotificationHelpers {
// 检查是否在过去2小时内已经发送过喝水提醒避免重复打扰
const lastNotificationKey = '@last_water_notification';
const AsyncStorage = (await import('@react-native-async-storage/async-storage')).default;
const AsyncStorage = (await import('@/utils/kvStore')).default;
const lastNotificationTime = await AsyncStorage.getItem(lastNotificationKey);
const now = new Date().getTime();
const twoHoursAgo = now - (2 * 60 * 60 * 1000); // 2小时前