enable dev|prod envs with simpler env vars system

This commit is contained in:
JCEEE
2026-08-06 18:09:47 +01:00
parent 2fc1668356
commit 4f384426d0
37 changed files with 447 additions and 256 deletions
+5 -4
View File
@@ -67,7 +67,7 @@ class FamStore {
private initPromise: Promise<void> | null = null;
async init(famId: string) {
async init(famId: string, initialFam?: Fam) {
if (this.initialized && this.famId === famId) return;
// Wait for any in-flight init to finish first
@@ -82,8 +82,11 @@ class FamStore {
this.initPromise = (async () => {
try {
// fams is superadmin-only (non-realtime, one-way writes). It is always
// fetched server-side by the layout load and passed in — never via the
// unauthenticated client PB SDK.
this.fam = initialFam || this.fam || ({} as Fam);
const [
famRes,
membersRes,
templatesRes,
assignedRes,
@@ -93,7 +96,6 @@ class FamStore {
rewardsRes,
seasonsRes
] = await Promise.all([
pb.collection('fams').getOne(famId) as Promise<Fam>,
pb.collection('members').getFullList({ filter: `famId = '${famId}'` }) as Promise<
Member[]
>,
@@ -119,7 +121,6 @@ class FamStore {
Season[]
>
]);
this.fam = famRes;
this.members = membersRes;
this.templates = templatesRes;
this.assigned = assignedRes;