fix: 修复 Android 闪退问题 - SecureStore 异步调用
问题: - NativeStorage 使用了同步方法调用 expo-secure-store - expo-secure-store 的正确 API 是异步的(getItemAsync/setItemAsync/deleteItemAsync) - 在 Android 上同步调用不存在的方法导致应用崩溃 修复: - 将 Storage 接口改为异步方法 - 使用 SecureStore.getItemAsync/setItemAsync/deleteItemAsync - removeItem 使用 deleteItemAsync 而不是设置空字符串 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
import { router } from 'expo-router';
|
||||
import { Colors, Spacing, FontSize, Layout } from '@/constants/theme';
|
||||
|
||||
interface CommonHeaderProps {
|
||||
@@ -23,9 +24,7 @@ export const CommonHeader: React.FC<CommonHeaderProps> = ({
|
||||
onBack();
|
||||
return;
|
||||
}
|
||||
if (typeof window !== 'undefined' && window.history) {
|
||||
window.history.back();
|
||||
}
|
||||
router.back();
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user