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
9dd9cb782a
commit
e65a3a9cf7
1 changed files with 8 additions and 0 deletions
|
@ -121,6 +121,14 @@ async function syncSplash() {
|
||||||
let load = (async () => {
|
let load = (async () => {
|
||||||
const splash = await callV2('GET', '/splash');
|
const splash = await callV2('GET', '/splash');
|
||||||
await Token.set('splash', JSON.stringify(splash));
|
await Token.set('splash', JSON.stringify(splash));
|
||||||
|
|
||||||
|
const now = Date.parse(new Date()) / 1000;
|
||||||
|
if((splash.start_time && splash.start_time > now) ||
|
||||||
|
(splash.end_time && now > splash.end_time)) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return splash;
|
return splash;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue