fix(events): replace db_events.file.clear() with targeted reload in refresh button
Same nuclear cache-clearing bug as the upload component fix. Clicking "Refresh files" for one Location was wiping every event_file record from Dexie, leaving all other Locations and Presenters with no files until their own background syncs fired. Now does a targeted load for the specific object only — same pattern as the upload component commit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
|||||||
slct,
|
slct,
|
||||||
slct_trigger
|
slct_trigger
|
||||||
} from '$lib/stores/ae_stores';
|
} from '$lib/stores/ae_stores';
|
||||||
import { db_events } from '$lib/ae_events/db_events';
|
|
||||||
import {
|
import {
|
||||||
events_loc,
|
events_loc,
|
||||||
events_sess,
|
events_sess,
|
||||||
@@ -151,30 +150,15 @@ async function handle_convert_pdf_to_image(event_file_obj: key_val) {
|
|||||||
<div class="float-right flex flex-row items-center">
|
<div class="float-right flex flex-row items-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={async () => {
|
||||||
console.log('*** Refresh button clicked ***');
|
await events_func.load_ae_obj_li__event_file({
|
||||||
|
|
||||||
db_events.file.clear();
|
|
||||||
|
|
||||||
// let params = {
|
|
||||||
// qry__enabled: 'all',
|
|
||||||
// qry__hidden: 'all',
|
|
||||||
// }
|
|
||||||
|
|
||||||
events_func.load_ae_obj_li__event_file({
|
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
for_obj_type: link_to_type,
|
for_obj_type: link_to_type,
|
||||||
for_obj_id: link_to_id,
|
for_obj_id: link_to_id,
|
||||||
enabled: 'all',
|
enabled: 'all',
|
||||||
hidden: 'all',
|
hidden: 'all',
|
||||||
// params: params,
|
|
||||||
try_cache: true
|
try_cache: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// ae_tmp.show__file_li = false;
|
|
||||||
// console.log(`$lq__event_file_obj_li:`, $lq__event_file_obj_li);
|
|
||||||
// $slct_trigger = 'load__event_file_obj_li';
|
|
||||||
// ae_tmp.show__file_li = true;
|
|
||||||
}}
|
}}
|
||||||
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-warning border-warning-500 m-1 border p-1 transition hover:transition-all *:hover:inline"
|
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-warning border-warning-500 m-1 border p-1 transition hover:transition-all *:hover:inline"
|
||||||
class:hidden={!$ae_loc.edit_mode || !$ae_loc.authenticated_access}
|
class:hidden={!$ae_loc.edit_mode || !$ae_loc.authenticated_access}
|
||||||
|
|||||||
Reference in New Issue
Block a user