Files
OSIT-AE-App-Svelte/tests/verify_jwt_sync.js
Scott Idem 88bc18cf15 fix(core): resolve 68 compiler errors and stabilize Svelte 5 reactivity
- 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.
2026-02-08 16:05:35 -05:00

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.");
}