diff --git a/src/pouchdb/platformReactNative.storage.ts b/src/pouchdb/platformReactNative.storage.ts index f294bc4ca..ce945c804 100644 --- a/src/pouchdb/platformReactNative.storage.ts +++ b/src/pouchdb/platformReactNative.storage.ts @@ -1,14 +1,14 @@ -import AsyncStorage from '@react-native-async-storage/async-storage' +import { storage as mmkvStorage } from '/libs/localStore' export const storage = { getItem: async (key: string): Promise => { - return AsyncStorage.getItem(key) + return Promise.resolve(mmkvStorage.getString(key) ?? null) }, setItem: async (key: string, value: string | undefined): Promise => { if (value === undefined) return - return AsyncStorage.setItem(key, value) + return Promise.resolve(mmkvStorage.set(key, value)) }, removeItem: async (key: string): Promise => { - return AsyncStorage.removeItem(key) + return Promise.resolve(mmkvStorage.delete(key)) } }