fix(frontend): initializeStores dedup + retryAllMessages guard + as any cleanup
- index.ts: add _storesInitialized guard to prevent triple initialization - offlineStore.ts: add isRetrying mutex for retryAllMessages concurrency - PropertyPanel.tsx: replace 13x (data as any) with typed d accessor - chatStore.ts: replace window as any with Record<string, unknown> - kernel-*.ts: replace prototype as any with Record<string, unknown> - gateway-heartbeat.ts: delete dead code (9 as any, zero imports)
This commit is contained in:
@@ -84,11 +84,16 @@ import { setConfigStoreClient } from './configStore';
|
||||
import { setSecurityStoreClient } from './securityStore';
|
||||
import { setSessionStoreClient } from './sessionStore';
|
||||
|
||||
let _storesInitialized = false;
|
||||
|
||||
/**
|
||||
* Initialize all stores with the shared client.
|
||||
* Called once when the application mounts.
|
||||
* Guard ensures it only runs once even if called from multiple connection paths.
|
||||
*/
|
||||
export function initializeStores(): void {
|
||||
if (_storesInitialized) return;
|
||||
_storesInitialized = true;
|
||||
const client = getClient();
|
||||
|
||||
// Inject client into all stores
|
||||
|
||||
Reference in New Issue
Block a user