From f7d28a7f43b81f77622bea7917494290f95a6d2c Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 27 Nov 2022 04:53:59 +0100 Subject: [PATCH] Fixed entity and tag restriction in campaign component. --- assets/components/campaigns/campaign.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assets/components/campaigns/campaign.vue b/assets/components/campaigns/campaign.vue index 0f154420..86737920 100755 --- a/assets/components/campaigns/campaign.vue +++ b/assets/components/campaigns/campaign.vue @@ -57,11 +57,14 @@ function entityCampaign() { if (bannerCampaigns.length > 0) { const randomCampaign = bannerCampaigns[Math.floor(Math.random() * bannerCampaigns.length)]; + this.campaign = randomCampaign; this.$emit('campaign', randomCampaign); + return randomCampaign; } this.$emit('campaign', null); + return null; } @@ -75,11 +78,14 @@ function tagCampaign() { banner, }; + this.campaign = randomCampaign; this.$emit('campaign', randomCampaign); + return randomCampaign; } this.$emit('campaign', null); + return null; } @@ -95,10 +101,12 @@ async function genericCampaign() { async function mounted() { if (this.entity) { await this.entityCampaign(); + return; } if (this.tag) { await this.tagCampaign(); + return; } await this.genericCampaign();