Fix: Resolve type errors and cleanup window.location.reload calls

This commit is contained in:
Scott Idem
2026-01-22 20:18:29 -05:00
parent c81ce50a00
commit a8e9c39ac6
5 changed files with 57 additions and 52 deletions

View File

@@ -192,7 +192,7 @@
title="Reload and clear the page cache" title="Reload and clear the page cache"
onclick={() => { onclick={() => {
// $ae_loc. // $ae_loc.
window.location.reload(true); window.location.reload();
}} }}
> >
<span class="fas fa-sync mx-1"></span> <span class="fas fa-sync mx-1"></span>

View File

@@ -492,7 +492,7 @@ class:to-90%={$ae_sess.show_help_tech} -->
goto('/', { invalidateAll: true }); goto('/', { invalidateAll: true });
// window.location.reload(true); // window.location.reload();
} else { } else {
// Confirm before clearing // Confirm before clearing
if ( if (
@@ -515,7 +515,7 @@ class:to-90%={$ae_sess.show_help_tech} -->
indexedDB.deleteDatabase('ae_posts_db'); // Posts module indexedDB.deleteDatabase('ae_posts_db'); // Posts module
indexedDB.deleteDatabase('ae_sponsorships_db'); // Sponsorships module indexedDB.deleteDatabase('ae_sponsorships_db'); // Sponsorships module
window.location.reload(true); window.location.reload();
} }
// This does not seem to work fast enough or something? // This does not seem to work fast enough or something?

View File

@@ -76,7 +76,7 @@
// *** Set initial variables // *** Set initial variables
let ae_promises: key_val = $state({}); // Promise<any>; let ae_promises: key_val = $state({}); // Promise<any>;
let patch_result: null | Promise<any> | key_val | string = $state(); let patch_result: null | Promise<any> | key_val | string | undefined = $state();
let original_field_value = $state(field_value); let original_field_value = $state(field_value);
@@ -118,17 +118,17 @@
// let params = {}; // let params = {};
ae_promises.api_update__ae_obj = core_func ae_promises.api_update__ae_obj = core_func
.handle_update_ae_obj_id_crud({ .update_ae_obj_id_crud({
api_cfg: api_cfg, api_cfg: api_cfg,
object_type: object_type, object_type: object_type,
object_id: object_id, object_id: object_id,
field_name: field_name, field_name: field_name,
new_field_value: new_field_value, field_value: new_field_value,
key: api_cfg?.api_crud_super_key ?? '', // Extract key from api_cfg if available
params: {}, params: {},
try_cache: false,
log_lvl: 0 log_lvl: 0
}) })
.then(function (results) { .then(function (results: any) {
console.log('Field PATCH Promise', results); console.log('Field PATCH Promise', results);
if (results) { if (results) {

View File

@@ -64,12 +64,17 @@
].filter(Boolean); ].filter(Boolean);
// Create editor // Create editor
if (!editor_container) {
console.error('Editor container not found.');
return;
}
editor_view = new cm.EditorView({ editor_view = new cm.EditorView({
state: cm.EditorState.create({ state: cm.EditorState.create({
doc: content ?? '', doc: content ?? '',
extensions extensions
}), }),
parent: editor_container parent: editor_container as HTMLElement
}); });
} }

View File

@@ -8,6 +8,49 @@
import { ae_util } from '$lib/ae_utils/ae_utils'; import { ae_util } from '$lib/ae_utils/ae_utils';
import type { key_val } from '$lib/stores/ae_stores'; import type { key_val } from '$lib/stores/ae_stores';
import { browser } from '$app/environment';
interface Props {
expire_minutes?: number;
mount_reload_sec?: number;
ds_code: string;
ds_name?: null | string;
ds_type?: string;
for_type?: null | string;
for_id?: null | string;
// export let store: string = 'local';
display?: string; // Avoid; Use class list instead
class_li?: string; // : string[] = [];
try_cache?: boolean;
hide?: boolean; // Hide the entire element
show_edit?: boolean;
show_edit_btn?: boolean;
show_view?: boolean;
// export let show_delete_btn: boolean = false;
ds_loaded?: boolean;
debug?: boolean;
val_sql?: null | key_val;
}
let {
expire_minutes = 10,
mount_reload_sec = 0,
ds_code,
ds_name = null,
ds_type = 'text',
for_type = null,
for_id = null,
display = 'block',
class_li = '',
try_cache = true,
hide = false,
show_edit = $bindable(false),
show_edit_btn = true,
show_view = $bindable(true),
ds_loaded = $bindable(false),
debug = false,
val_sql = $bindable(null)
}: Props = $props();
console.log( console.log(
`ae_e_data_store ${ds_code} for_type=${for_type} for_id=${for_id} account_id=${$ae_loc.account_id}` `ae_e_data_store ${ds_code} for_type=${for_type} for_id=${for_id} account_id=${$ae_loc.account_id}`
); );
@@ -68,49 +111,6 @@
// console.log(`ae_e_data_store ae_ds_loc = `, ae_ds_tmp); // console.log(`ae_e_data_store ae_ds_loc = `, ae_ds_tmp);
// } // }
import { browser } from '$app/environment';
interface Props {
expire_minutes?: number;
mount_reload_sec?: number;
ds_code: string;
ds_name?: null | string;
ds_type?: string;
for_type?: null | string;
for_id?: null | string;
// export let store: string = 'local';
display?: string; // Avoid; Use class list instead
class_li?: string; // : string[] = [];
try_cache?: boolean;
hide?: boolean; // Hide the entire element
show_edit?: boolean;
show_edit_btn?: boolean;
show_view?: boolean;
// export let show_delete_btn: boolean = false;
ds_loaded?: boolean;
debug?: boolean;
val_sql?: null | key_val;
}
let {
expire_minutes = 10,
mount_reload_sec = 0,
ds_code,
ds_name = null,
ds_type = 'text',
for_type = null,
for_id = null,
display = 'block',
class_li = '',
try_cache = true,
hide = false,
show_edit = $bindable(false),
show_edit_btn = true,
show_view = $bindable(true),
ds_loaded = $bindable(false),
debug = false,
val_sql = $bindable(null)
}: Props = $props();
let ae_ds_loc_test: any; let ae_ds_loc_test: any;
if (browser) { if (browser) {
console.log('ae_e_data_store Browser detected.'); console.log('ae_e_data_store Browser detected.');