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
9dd9cb782a
commit
e65a3a9cf7
1 changed files with 8 additions and 0 deletions
|
@ -121,6 +121,14 @@ async function syncSplash() {
|
|||
let load = (async () => {
|
||||
const splash = await callV2('GET', '/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;
|
||||
})();
|
||||
|
||||
|
|
Loading…
Reference in a new issue