Separating out components and functions to make things more modular.
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
/** @type {import('./$types').LayoutLoad} */
|
||||
// console.log(`ae_root +layout.ts start`);
|
||||
// console.log(`ae_root +layout.ts: start`);
|
||||
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { get } from 'svelte/store';
|
||||
import { browser } from '$app/environment';
|
||||
|
||||
// import { api } from '$lib/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
|
||||
// import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { core_func } from '$lib/ae_core_functions';
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
|
||||
@@ -90,7 +88,7 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
|
||||
// console.log(`ae_ ds_code_li = `, ds_code_li);
|
||||
let ds_code: null|string = null;
|
||||
|
||||
let data_struct = {
|
||||
let data_struct: key_val = {
|
||||
// ae_acct should only be updated and referenced by the corresponding account_id.
|
||||
account_id: null,
|
||||
ae_acct: {
|
||||
@@ -178,10 +176,6 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
|
||||
}
|
||||
// console.log(ae_loc_init);
|
||||
|
||||
// if (browser) {
|
||||
// localStorage.setItem('ae_account_id', await account_id);
|
||||
// }
|
||||
|
||||
// NOTE: We need to wait for the account_id to be returned before we can continue. It is required for the api_cfg.
|
||||
let ds_type: null|string = 'json';
|
||||
ds_code = 'hub__page__access_code_li_json';
|
||||
@@ -223,16 +217,3 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
|
||||
|
||||
return data_struct;
|
||||
}
|
||||
|
||||
|
||||
// ds_type = 'text';
|
||||
// ds_code = 'hub__site__appshell_header';
|
||||
// ds_code_li[ds_code] = await core_func.handle_load_ae_obj_code__data_store({api_cfg: ae_api_tmp, code: ds_code, data_type: ds_type})
|
||||
// .then(function (ds_results) {
|
||||
// if (ds_results) {
|
||||
// console.log(`ae_ ds_results = `, ds_results);
|
||||
// return ds_results;
|
||||
// }
|
||||
|
||||
// }
|
||||
// );
|
||||
|
||||
Reference in New Issue
Block a user