diff --git a/package.json b/package.json index 301bd67..05698fc 100755 --- a/package.json +++ b/package.json @@ -28,17 +28,19 @@ "license": "ISC", "devDependencies": { "@eslint/js": "^9.38.0", + "@testing-library/jest-dom": "^6.1.4", + "@types/jest": "^29.5.8", "@typescript-eslint/eslint-plugin": "^8.46.2", "@typescript-eslint/parser": "^8.46.2", "eslint": "^9.38.0", + "jest": "^29.7.0", "prettier": "^3.3.3", + "ts-jest": "^29.1.1", "typescript": "^5.3.3", "vite": "^5.4.11", "vite-plugin-static-copy": "^1.0.6", - "jest": "^29.7.0", - "ts-jest": "^29.1.1", - "@types/jest": "^29.5.8", - "@testing-library/jest-dom": "^6.1.4" + "vite-plugin-top-level-await": "^1.6.0", + "vite-plugin-wasm": "^3.5.0" }, "dependencies": { "axios": "^1.7.8", @@ -47,7 +49,6 @@ "pdf-lib": "^1.17.1", "sweetalert2": "^11.14.5", "vite-plugin-copy": "^0.1.6", - "vite-plugin-html": "^3.2.2", - "vite-plugin-wasm": "^3.3.0" + "vite-plugin-html": "^3.2.2" } } diff --git a/src/pages/home/home.ts b/src/pages/home/home.ts index 70999e4..4c4982d 100755 --- a/src/pages/home/home.ts +++ b/src/pages/home/home.ts @@ -397,6 +397,10 @@ export function initIframeCommunication() { console.log('👂 Parent is listening for messages'); break; + case 'IFRAME_READY': + console.log('✅ Iframe is ready and initialized'); + break; + default: console.log('❓ Unknown message type from parent:', type); } diff --git a/src/router.ts b/src/router.ts index 7a79396..1b3d318 100755 --- a/src/router.ts +++ b/src/router.ts @@ -61,8 +61,7 @@ async function handleLocation(path: string) { await new Promise(requestAnimationFrame); - // Initialize essential functions - await initEssentialFunctions(); + // Essential functions are now handled directly in the application // const modalService = await ModalService.getInstance() // modalService.injectValidationModal() diff --git a/src/websockets.ts b/src/websockets.ts index 1387147..c9e8e3e 100755 --- a/src/websockets.ts +++ b/src/websockets.ts @@ -34,7 +34,8 @@ export async function initWebsocket(url: string) { secureLogger.warn('Invalid WebSocket message received', { component: 'WebSocket', operation: 'message_validation', - errors: validation.errors + errors: validation.errors, + messagePreview: msgData.substring(0, 100) // Log first 100 chars for debugging }); return; } diff --git a/vite.config.ts b/vite.config.ts index f2f5c53..b744222 100755 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,11 +1,16 @@ import { defineConfig } from 'vite'; -import path from 'path' +import path from 'path'; +import wasm from 'vite-plugin-wasm'; +import topLevelAwait from 'vite-plugin-top-level-await'; export default defineConfig({ optimizeDeps: { include: ['qrcode'] }, - plugins: [], + plugins: [ + wasm(), + topLevelAwait() + ], build: { outDir: 'dist', target: 'esnext',