feat: 添加后台任务测试通知功能,优化滑动删除交互体验
This commit is contained in:
@@ -424,6 +424,19 @@ export default function ExploreScreen() {
|
||||
handler: async () => {
|
||||
try {
|
||||
console.log('后台任务:更新健康数据和检查压力水平...');
|
||||
|
||||
// 发送测试通知,验证后台任务是否执行
|
||||
await notificationService.sendImmediateNotification({
|
||||
title: '后台任务测试 🔔',
|
||||
body: `任务执行时间: ${new Date().toLocaleTimeString('zh-CN')}`,
|
||||
data: {
|
||||
type: 'background_task_test',
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
sound: true,
|
||||
priority: 'high'
|
||||
});
|
||||
|
||||
// 后台任务只更新健康数据,强制刷新以获取最新数据
|
||||
await loadHealthData(undefined, true);
|
||||
|
||||
|
||||
@@ -138,20 +138,6 @@ export default function LoginScreen() {
|
||||
}
|
||||
}, [appleAvailable, router, searchParams?.redirectParams, searchParams?.redirectTo]);
|
||||
|
||||
const onGuestLogin = useCallback(() => {
|
||||
// 游客继续:若有 redirect 则前往,无则返回
|
||||
const to = searchParams?.redirectTo as string | undefined;
|
||||
const paramsJson = searchParams?.redirectParams as string | undefined;
|
||||
let parsedParams: Record<string, any> | undefined;
|
||||
if (paramsJson) {
|
||||
try { parsedParams = JSON.parse(paramsJson); } catch { }
|
||||
}
|
||||
if (to) {
|
||||
router.replace({ pathname: to, params: parsedParams } as any);
|
||||
} else {
|
||||
router.back();
|
||||
}
|
||||
}, [router, searchParams?.redirectParams, searchParams?.redirectTo]);
|
||||
|
||||
// 登录按钮不再因未勾选协议而禁用,仅在加载中禁用
|
||||
|
||||
|
||||
Reference in New Issue
Block a user