mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 01:49:30 +08:00
syncSplash 增加 500ms 超时
This commit is contained in:
parent
9d92ecc502
commit
9dd9cb782a
1 changed files with 10 additions and 3 deletions
|
@ -118,10 +118,17 @@ async function getSplashByStore() {
|
|||
}
|
||||
|
||||
async function syncSplash() {
|
||||
const splash = await callV2('GET', '/splash');
|
||||
await Token.set('splash', JSON.stringify(splash));
|
||||
let load = (async () => {
|
||||
const splash = await callV2('GET', '/splash');
|
||||
await Token.set('splash', JSON.stringify(splash));
|
||||
return splash;
|
||||
})();
|
||||
|
||||
return splash;
|
||||
let timer = new Promise((resolve, reject) => {
|
||||
setTimeout(resolve, 500)
|
||||
});
|
||||
|
||||
return Promise.race([load, timer]);
|
||||
}
|
||||
|
||||
async function getSelfInfo() {
|
||||
|
|
Loading…
Reference in a new issue