feat(app): 优化Expo Updates更新机制,改进睡眠阶段时间轴UI设计,升级项目依赖

This commit is contained in:
richarjiang
2025-12-05 17:17:16 +08:00
parent 74b49efe23
commit 37a0687456
7 changed files with 1314 additions and 447 deletions

View File

@@ -488,7 +488,15 @@ function Bootstrapper({ children }: { children: React.ReactNode }) {
useEffect(() => {
async function checkUpdate() {
try {
logger.info("Checking for updates...");
logger.info(`Checking for updates..., env: ${__DEV__}, Updates.isEnabled: ${Updates.isEnabled}`);
// 只有在 expo-updates 启用时才检查更新
// 开发环境或 Updates 未启用时跳过
if (__DEV__ || !Updates.isEnabled) {
logger.info('Skipping update check: dev mode or updates not enabled');
return;
}
const update = await Updates.checkForUpdateAsync();
logger.info("Update check:", update);
@@ -499,7 +507,7 @@ function Bootstrapper({ children }: { children: React.ReactNode }) {
if (result.isNew) {
logger.info("Reloading app to apply update...");
Updates.reloadAsync();
await Updates.reloadAsync();
}
}
} catch (e) {