WellNuo Lite architecture: - Simplified navigation flow with NavigationController - Profile editing with API sync (/auth/profile endpoint) - OTP verification improvements - ESP WiFi provisioning setup (espProvisioning.ts) - E2E testing infrastructure (Playwright) - Speech recognition hooks (web/native) - Backend auth enhancements This is the stable version submitted to App Store. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
807 B
TypeScript
36 lines
807 B
TypeScript
/**
|
|
* Cross-platform storage service
|
|
* Uses SecureStore on native, localStorage on web
|
|
*/
|
|
import { Platform } from 'react-native';
|
|
import * as SecureStore from 'expo-secure-store';
|
|
|
|
const isWeb = Platform.OS === 'web';
|
|
|
|
export const storage = {
|
|
async getItem(key: string): Promise<string | null> {
|
|
if (isWeb) {
|
|
return localStorage.getItem(key);
|
|
}
|
|
return SecureStore.getItemAsync(key);
|
|
},
|
|
|
|
async setItem(key: string, value: string): Promise<void> {
|
|
if (isWeb) {
|
|
localStorage.setItem(key, value);
|
|
return;
|
|
}
|
|
return SecureStore.setItemAsync(key, value);
|
|
},
|
|
|
|
async deleteItem(key: string): Promise<void> {
|
|
if (isWeb) {
|
|
localStorage.removeItem(key);
|
|
return;
|
|
}
|
|
return SecureStore.deleteItemAsync(key);
|
|
},
|
|
};
|
|
|
|
export default storage;
|