APP-PUSH和纯色小组件

This commit is contained in:
吕新雨
2026-02-05 01:14:13 +08:00
parent c1c2c6197d
commit 4c03fce720
28 changed files with 258 additions and 156 deletions

View File

@@ -7,6 +7,7 @@ import { httpJson } from '../utils/http';
import { APP_ENV } from '../constants/env';
import { getDailyReminderSettings, getOrCreateClientUserId, getUserProfileScoring } from '../storage/appStorage';
import type { UserProfileScoring } from '../storage/appStorage';
import { toBackendLocaleFromLanguageTag } from '../i18n/locale';
export type PushEnv = 'dev' | 'prod';
@@ -44,11 +45,7 @@ export type PushPreferencesResponse = PushPreferencesRequest & {
};
export function buildAcceptLanguage(): 'en' | 'tc' {
const lang = (i18n.language || '').trim();
const lower = lang.toLowerCase();
if (lower.startsWith('zh')) return 'tc';
if (lower.includes('tc') || lower.includes('hant') || lower.includes('hk') || lower.includes('mo') || lower.includes('tw')) return 'tc';
return 'en';
return toBackendLocaleFromLanguageTag(i18n.language);
}
function toPushEnv(appEnv: typeof APP_ENV): PushEnv {