mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 09:59:31 +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() {
|
async function syncSplash() {
|
||||||
const splash = await callV2('GET', '/splash');
|
let load = (async () => {
|
||||||
await Token.set('splash', JSON.stringify(splash));
|
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() {
|
async function getSelfInfo() {
|
||||||
|
|
Loading…
Reference in a new issue