mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 09:59:31 +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());
|
Alert.alert("loadIcon err: " + err.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var splash;
|
||||||
try {
|
try {
|
||||||
//todo:当服务器不可用时,可能会卡在这里很长时间
|
splash = await Api.syncSplash();
|
||||||
//之前的做法是异步更新数据,在下一次打开 app 时从本地读取
|
|
||||||
await Api.syncSplash();
|
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,9 +120,15 @@ Navigation.events().registerAppLaunchedListener(async () => {
|
||||||
const password = await Token.getLoginPassword();
|
const password = await Token.getLoginPassword();
|
||||||
if(password) {
|
if(password) {
|
||||||
loginByPassword();
|
loginByPassword();
|
||||||
|
|
||||||
} else {
|
} 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