Showing curated campaigns on tags page.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const withQuery = Object.hasOwn(pageContext.urlParsed.search, 'q');
|
||||
@@ -35,7 +35,7 @@ export async function onBeforeRender(pageContext) {
|
||||
total,
|
||||
} = sceneResults;
|
||||
|
||||
const campaignIndex = Math.floor((Math.random() * (0.5 - 0.2) + 0.2) * scenes.length);
|
||||
const campaignIndex = getCampaignIndex(scenes.length);
|
||||
const [scopeCampaign, sceneCampaign, paginationCampaign] = campaigns;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user