fix:同意隐私

This commit is contained in:
吕新雨
2026-02-05 16:33:58 +08:00
parent 8e71503169
commit 1e1e49ea57
5 changed files with 138 additions and 53 deletions

View File

@@ -139,7 +139,10 @@ export default function ProfileModal({ visible, name: propName, onClose }: Props
const openLink = useCallback(
async (url?: string) => {
if (!url) return;
if (!url) {
Alert.alert(t('common.notice'), t('consent.linkUnavailable'));
return;
}
try {
await WebBrowser.openBrowserAsync(url);
} catch (error) {
@@ -435,7 +438,14 @@ function DailyReminderPage({ visible, onDone }: { visible: boolean; onDone: () =
try {
const expoPushToken = await getExpoPushTokenOrThrow();
await registerPushToken({ pushToken: expoPushToken });
await setPushPreferences({ enabled: true, timesPerDay });
// 偏好同步失败不应被用户感知为“开启失败”
// (常见现象:后端已接收 token但偏好接口短暂失败/超时)
try {
await setPushPreferences({ enabled: true, timesPerDay });
} catch (e) {
const msg = e instanceof Error ? e.message : String(e);
console.warn('[PushPreferences] 同步失败ProfileModal不阻塞', msg);
}
} catch (e) {
const msg = e instanceof Error ? e.message : String(e);
Alert.alert(t('common.notice'), msg);