Hardened Journals and IDAA module load functions for offline resilience and ghost account support.
This commit is contained in:
@@ -11,7 +11,18 @@ export async function load({ fetch, parent }) {
|
||||
|
||||
const account_id = parent_data.account_id;
|
||||
|
||||
const ae_acct = parent_data[account_id];
|
||||
let ae_acct = parent_data[account_id];
|
||||
|
||||
if (!ae_acct) {
|
||||
console.warn(`ae Journals +page.ts: Account ${account_id} not found in parent data. Initializing ghost acct.`);
|
||||
ae_acct = {
|
||||
api: parent_data.ae_api || {},
|
||||
loc: {},
|
||||
slct: {
|
||||
account_id: account_id
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const journal_id = ae_acct.slct.journal_id; // From root +layout.ts
|
||||
if (!journal_id) {
|
||||
|
||||
Reference in New Issue
Block a user