Fixed entity and tag restriction in campaign component.

This commit is contained in:
DebaucheryLibrarian 2022-11-27 04:53:59 +01:00
parent 84f833ac31
commit f7d28a7f43
1 changed files with 8 additions and 0 deletions

View File

@ -57,11 +57,14 @@ function entityCampaign() {
if (bannerCampaigns.length > 0) { if (bannerCampaigns.length > 0) {
const randomCampaign = bannerCampaigns[Math.floor(Math.random() * bannerCampaigns.length)]; const randomCampaign = bannerCampaigns[Math.floor(Math.random() * bannerCampaigns.length)];
this.campaign = randomCampaign;
this.$emit('campaign', randomCampaign); this.$emit('campaign', randomCampaign);
return randomCampaign; return randomCampaign;
} }
this.$emit('campaign', null); this.$emit('campaign', null);
return null; return null;
} }
@ -75,11 +78,14 @@ function tagCampaign() {
banner, banner,
}; };
this.campaign = randomCampaign;
this.$emit('campaign', randomCampaign); this.$emit('campaign', randomCampaign);
return randomCampaign; return randomCampaign;
} }
this.$emit('campaign', null); this.$emit('campaign', null);
return null; return null;
} }
@ -95,10 +101,12 @@ async function genericCampaign() {
async function mounted() { async function mounted() {
if (this.entity) { if (this.entity) {
await this.entityCampaign(); await this.entityCampaign();
return;
} }
if (this.tag) { if (this.tag) {
await this.tagCampaign(); await this.tagCampaign();
return;
} }
await this.genericCampaign(); await this.genericCampaign();