mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 01:49:30 +08:00
修复欢迎页不显示问题
This commit is contained in:
parent
456e7261e8
commit
fcf86bc1aa
1 changed files with 10 additions and 5 deletions
15
index.js
15
index.js
|
@ -105,10 +105,9 @@ Navigation.events().registerAppLaunchedListener(async () => {
|
|||
Alert.alert("loadIcon err: " + err.toString());
|
||||
}
|
||||
|
||||
var splash;
|
||||
try {
|
||||
//todo:当服务器不可用时,可能会卡在这里很长时间
|
||||
//之前的做法是异步更新数据,在下一次打开 app 时从本地读取
|
||||
await Api.syncSplash();
|
||||
splash = await Api.syncSplash();
|
||||
} catch (err) {}
|
||||
|
||||
|
||||
|
@ -121,9 +120,15 @@ Navigation.events().registerAppLaunchedListener(async () => {
|
|||
const password = await Token.getLoginPassword();
|
||||
if(password) {
|
||||
loginByPassword();
|
||||
|
||||
} else {
|
||||
Navigation.setRoot(BottomNav.config());
|
||||
if(!splash) {
|
||||
try {
|
||||
splash = await Api.getSplashByStore();
|
||||
} catch(e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
Navigation.setRoot(BottomNav.config(splash));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue