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:
@@ -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小时前
|
||||
|
||||
Reference in New Issue
Block a user