hopefully make the page load faster
All checks were successful
deploy / deploy (push) Successful in 53s

This commit is contained in:
Lee 2023-10-24 12:35:59 +01:00
parent af4c117894
commit 2303409ecb

@ -21,19 +21,23 @@ export default class AppProvider extends React.Component {
}
this._state.mounted = true;
// Load data from async storage
await useSettingsStore.persist.rehydrate();
await useScoresaberScoresStore.persist.rehydrate();
const initUpdater = async () => {
// Load data from async storage
await useSettingsStore.persist.rehydrate();
await useScoresaberScoresStore.persist.rehydrate();
await useSettingsStore.getState().refreshProfiles();
setInterval(() => {
useSettingsStore.getState().refreshProfiles();
}, UPDATE_INTERVAL);
await useSettingsStore.getState().refreshProfiles();
setInterval(() => {
useSettingsStore.getState().refreshProfiles();
}, UPDATE_INTERVAL);
await useScoresaberScoresStore.getState().updatePlayerScores();
setInterval(() => {
useScoresaberScoresStore.getState().updatePlayerScores();
}, UPDATE_INTERVAL);
await useScoresaberScoresStore.getState().updatePlayerScores();
setInterval(() => {
useScoresaberScoresStore.getState().updatePlayerScores();
}, UPDATE_INTERVAL);
};
initUpdater();
}
constructor(props: any) {