ui: Fix errors after migration
This commit is contained in:
parent
47776eeeb4
commit
d791e74a2a
10 changed files with 110 additions and 96 deletions
|
|
@ -28,22 +28,24 @@ function createTeamsStore() {
|
|||
}
|
||||
}
|
||||
|
||||
async function refreshFunc(cb=null, interval=null) {
|
||||
if (refresh_interval_teams)
|
||||
clearInterval(refresh_interval_teams);
|
||||
if (interval === null) {
|
||||
interval = Math.floor(Math.random() * 24000) + 32000;
|
||||
}
|
||||
if (stop_refresh) {
|
||||
return;
|
||||
}
|
||||
refresh_interval_teams = setInterval(refreshFunc, interval);
|
||||
|
||||
updateFunc(await fetch('teams.json', {headers: {'Accept': 'application/json'}}), cb);
|
||||
}
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
|
||||
refresh: async (cb=null, interval=null) => {
|
||||
if (refresh_interval_teams)
|
||||
clearInterval(refresh_interval_teams);
|
||||
if (interval === null) {
|
||||
interval = Math.floor(Math.random() * 24000) + 32000;
|
||||
}
|
||||
if (stop_refresh) {
|
||||
return;
|
||||
}
|
||||
refresh_interval_teams = setInterval(refresh_teams, interval);
|
||||
|
||||
updateFunc(await fetch('teams.json', {headers: {'Accept': 'application/json'}}), cb);
|
||||
},
|
||||
refresh: refreshFunc,
|
||||
|
||||
update: updateFunc,
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue