[optim] don't fetch profile terms if not necessary

This commit is contained in:
Andrea Vos 2021-06-17 23:10:26 +02:00
parent 8b73ed6ac5
commit 5b4946ea14

View File

@ -178,14 +178,19 @@
glue: ' ' + this.$t('pronouns.or') + ' ',
allFlags: process.env.FLAGS,
saving: false,
terms: [],
}
},
async asyncData({ app, route }) {
return {
profiles: await app.$axios.$get(`/profile/get/${encodeURIComponent(route.params.pathMatch)}`),
terms: await app.$axios.$get(`/terms`),
};
},
async mounted() {
if (this.config.nouns.terms.enabled) {
this.terms = await this.$axios.$get(`/terms`);
}
},
computed: {
username() {
const base = this.$route.params.pathMatch;