enable dev|prod envs with simpler env vars system
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user