Improve page load times
This commit is contained in:
parent
4b32ac1f96
commit
042a25f90a
@ -119,8 +119,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
await loadPremium();
|
||||
await loadSettings();
|
||||
});
|
||||
withLoadingScreen(async () => await Promise.all([
|
||||
loadPremium(),
|
||||
loadSettings()
|
||||
]));
|
||||
</script>
|
||||
|
@ -227,9 +227,12 @@
|
||||
}
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
await loadPanels();
|
||||
await loadChannels();
|
||||
await loadData();
|
||||
await Promise.all([
|
||||
loadPanels(),
|
||||
loadChannels()
|
||||
]);
|
||||
|
||||
await loadData(); // Depends on channels
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -82,9 +82,12 @@
|
||||
}
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
setDefaultHeaders();
|
||||
await loadPremium();
|
||||
await loadColours();
|
||||
setDefaultHeaders(); // TODO: Is this needed?
|
||||
|
||||
await Promise.all([
|
||||
loadPremium(),
|
||||
loadColours()
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -332,14 +332,16 @@
|
||||
}
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
await loadPremium();
|
||||
await loadChannels();
|
||||
await loadTeams();
|
||||
await loadForms();
|
||||
await loadRoles();
|
||||
await loadPanels();
|
||||
await loadMultiPanels();
|
||||
})
|
||||
await Promise.all([
|
||||
loadPremium(),
|
||||
loadChannels(),
|
||||
loadTeams(),
|
||||
loadForms(),
|
||||
loadRoles(),
|
||||
loadPanels(),
|
||||
loadMultiPanels()
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
@ -229,9 +229,13 @@
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
setDefaultHeaders();
|
||||
await loadTeams();
|
||||
await loadRoles();
|
||||
await updateActiveTeam();
|
||||
|
||||
await Promise.all([
|
||||
loadTeams(),
|
||||
loadRoles()
|
||||
]);
|
||||
|
||||
await updateActiveTeam(); // Depends on teams
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -126,8 +126,10 @@
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
setDefaultHeaders();
|
||||
await loadPremium();
|
||||
await loadMessages();
|
||||
await Promise.all([
|
||||
loadPremium(),
|
||||
loadMessages()
|
||||
]);
|
||||
|
||||
scrollContainer();
|
||||
|
||||
|
@ -204,15 +204,7 @@
|
||||
panels = res.data;
|
||||
}
|
||||
|
||||
async function loadSettings() {
|
||||
const res = await axios.get(`${API_URL}/api/${guildId}/settings`);
|
||||
if (res.status !== 200) {
|
||||
notifyError(res.data.error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
async function loadData(paginationSettings) {
|
||||
async function loadData(paginationSettings) {
|
||||
const res = await axios.post(`${API_URL}/api/${guildId}/transcripts`, paginationSettings);
|
||||
if (res.status !== 200) {
|
||||
notifyError(res.data.error);
|
||||
@ -224,9 +216,10 @@
|
||||
}
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
await loadPanels();
|
||||
await loadSettings();
|
||||
await loadData({})
|
||||
await Promise.all([
|
||||
loadPanels(),
|
||||
loadData({})
|
||||
])
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -338,9 +338,11 @@
|
||||
|
||||
withLoadingScreen(async () => {
|
||||
if (await loadBot()) {
|
||||
await loadErrors();
|
||||
await loadInteractionUrl();
|
||||
await loadPublicKey();
|
||||
await Promise.all([
|
||||
loadErrors(),
|
||||
loadInteractionUrl(),
|
||||
loadPublicKey()
|
||||
]);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user