load first pages serial instead parallel
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Artem Anufrij
2023-10-05 13:31:46 +02:00
parent 836c46db32
commit 740152500e
4 changed files with 33 additions and 21 deletions

View File

@@ -13,12 +13,15 @@ export default {
})
},
loadArtists(context, force) {
if ((!context.state.eos || force) && !context.state.loading) {
context.state.loading = true;
axios.get(context.rootGetters.server + "/api/artists/page/" + context.state.page++, context.rootGetters.headers).then((res) => {
context.commit("setArtists", res.data);
});
}
return new Promise((resolve) => {
if ((!context.state.eos || force) && !context.state.loading) {
context.state.loading = true;
axios.get(context.rootGetters.server + "/api/artists/page/" + context.state.page++, context.rootGetters.headers).then((res) => {
context.commit("setArtists", res.data);
resolve(res.data);
});
}
});
},
loadArtist(context, id) {
context.state.loading = true;