From 35b01d90107aea8ba2bd5124c9e90804d4243a4f Mon Sep 17 00:00:00 2001 From: elweyn Date: Mon, 25 Oct 2021 10:53:56 +0200 Subject: [PATCH] Change the register site so that it loads community information if their is none. --- frontend/src/views/Pages/Register.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/src/views/Pages/Register.vue b/frontend/src/views/Pages/Register.vue index ff83f84fc..d7909c964 100755 --- a/frontend/src/views/Pages/Register.vue +++ b/frontend/src/views/Pages/Register.vue @@ -161,6 +161,7 @@ import InputEmail from '../../components/Inputs/InputEmail.vue' import InputPasswordConfirmation from '../../components/Inputs/InputPasswordConfirmation.vue' import LanguageSwitchSelect from '../../components/LanguageSwitchSelect.vue' import { registerUser } from '../../graphql/mutations' +import { communityInfo } from '../../graphql/queries' export default { components: { InputPasswordConfirmation, InputEmail, LanguageSwitchSelect }, @@ -228,6 +229,20 @@ export default { this.form.password.passwordRepeat = '' this.language = '' }, + async onCreated() { + if (!this.$state.store.community) { + this.$apollo + .query({ + query: communityInfo, + }) + .then((result) => { + this.$store.commit('community', result.data.getCommunityInfo) + }) + .catch((error) => { + this.$toasted.error(error.message) + }) + } + }, }, computed: { namesFilled() { @@ -242,6 +257,9 @@ export default { return this.form.email !== '' }, }, + created() { + this.onCreated() + }, }