From 5b4946ea1480223d7047ee65dda700ea476891c7 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Thu, 17 Jun 2021 23:10:26 +0200 Subject: [PATCH] [optim] don't fetch profile terms if not necessary --- routes/profile.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/routes/profile.vue b/routes/profile.vue index 7ab430c32..1d3f8dc8a 100644 --- a/routes/profile.vue +++ b/routes/profile.vue @@ -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;