feat(app): 优化Expo Updates更新机制,改进睡眠阶段时间轴UI设计,升级项目依赖
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user