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