add platform demo fam
This commit is contained in:
@@ -3,6 +3,7 @@ import { createPbClient } from '$lib/server/pocketbase';
|
||||
import { createServices, type ChatActor } from '$lib/server/services';
|
||||
import { ensureFamAccess } from '$lib/server/access';
|
||||
import { seedDemoCompletions } from '$lib/server/migrate';
|
||||
import { getPlatformFlags } from '$lib/server/platform';
|
||||
|
||||
async function paydayCheck(famId: string, pbToken: string) {
|
||||
try {
|
||||
@@ -47,8 +48,8 @@ async function resolveChatIdentity(
|
||||
}
|
||||
|
||||
export async function load(event) {
|
||||
// Demo family: rotate 3-week completion data on every visit (idempotent).
|
||||
if (event.params.fam === 'showboaters') {
|
||||
// Demo family: rotate 3-week completion data on every visit when demo mode is on (idempotent).
|
||||
if (event.params.fam === 'showboaters' && (await getPlatformFlags()).demo) {
|
||||
seedDemoCompletions().catch(() => {});
|
||||
}
|
||||
|
||||
@@ -94,6 +95,8 @@ export async function load(event) {
|
||||
}
|
||||
}
|
||||
|
||||
const demoMode = (await getPlatformFlags()).demo;
|
||||
|
||||
return {
|
||||
// Canonical fam slug — from the URL param ([fam] routes). Client code
|
||||
// reads page.data.famSlug; never copy it into local $state.
|
||||
@@ -117,6 +120,7 @@ export async function load(event) {
|
||||
chat,
|
||||
pbToken,
|
||||
fam,
|
||||
famAccess
|
||||
famAccess,
|
||||
demoMode
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user