- Fixed 'Captured initial value' warnings in 65+ components by implementing proper sync effects with 'untrack' and derived states. - Hardened Event Settings JSON editors using a temporary string-buffer pattern to safely decouple object-based data from CodeMirror's string requirements. - Resolved strict TypeScript mismatches across core routes (Accounts, Sites, etc.) and improved property indexing safety in views. - Patched Flowbite-Svelte Drawer transitions for Svelte 5 compatibility using prop spreading. - Added comprehensive safety comments to high-risk reactivity blocks. - Synchronized 'ae_types.ts' with V3 backend models.
26 lines
616 B
JavaScript
26 lines
616 B
JavaScript
|
|
// @ts-nocheck
|
|
let ae_loc_mock = { jwt: 'valid-jwt-token' };
|
|
let ae_api_mock = { headers: {} };
|
|
|
|
function simulate_effect() {
|
|
if (ae_api_mock.jwt !== ae_loc_mock.jwt) {
|
|
console.log('Syncing JWT to API config');
|
|
ae_api_mock = {
|
|
...ae_api_mock,
|
|
jwt: ae_loc_mock.jwt
|
|
};
|
|
}
|
|
}
|
|
|
|
console.log("--- Test: Sync JWT Effect ---");
|
|
console.log("Before:", ae_api_mock);
|
|
simulate_effect();
|
|
console.log("After:", ae_api_mock);
|
|
|
|
if (ae_api_mock.jwt === 'valid-jwt-token') {
|
|
console.log("PASS: JWT synced correctly.");
|
|
} else {
|
|
console.error("FAIL: JWT not synced.");
|
|
}
|