From 9e52fcfe36eaef52623bb159d80cc3e2b419a280 Mon Sep 17 00:00:00 2001 From: Erik Borgeteien Hansen <erik@erikbhan.no> Date: Tue, 3 May 2022 15:51:20 +0200 Subject: [PATCH] bugfix --- src/components/CommunityComponents/CommunityHamburger.vue | 4 ++-- src/views/CommunityViews/CommunityView.vue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/CommunityComponents/CommunityHamburger.vue b/src/components/CommunityComponents/CommunityHamburger.vue index f9d4b41..391a9ab 100644 --- a/src/components/CommunityComponents/CommunityHamburger.vue +++ b/src/components/CommunityComponents/CommunityHamburger.vue @@ -57,8 +57,8 @@ export default { this.$router.push("/"); }, }, - mounted() { - this.admin = CommunityAdminService.isUserAdmin( + async mounted() { + this.admin = await CommunityAdminService.isUserAdmin( this.$route.params.communityID ); }, diff --git a/src/views/CommunityViews/CommunityView.vue b/src/views/CommunityViews/CommunityView.vue index 8755c39..7e92e9b 100644 --- a/src/views/CommunityViews/CommunityView.vue +++ b/src/views/CommunityViews/CommunityView.vue @@ -40,13 +40,13 @@ export default { this.publicCommunities = await getVisibleGroups(); this.loggedIn = this.$store.state.user.token !== null; if (!this.loggedIn) return; - this.myCommunities = await getMyGroups(); - }, - mounted() { + // Double loop is bad; find a better way to do this for (var i = 0; i < this.publicCommunities.length; i++) { for (var j = 0; j < this.myCommunities.length; j++) { + console.log(this.publicCommunities[i]); + console.log(this.myCommunities[j]); if ( this.publicCommunities[i].communityId === this.myCommunities[j].communityId -- GitLab