Files
seedpgp-web/src/main.tsx
LC mac 7cec260ad1 fix: Correct sessionCrypto import paths and restore missing module
- Fix App.tsx import from '../.Ref/sessionCrypto' to './lib/sessionCrypto'
- Fix main.tsx import from '../.Ref/sessionCrypto' to './lib/sessionCrypto'
- Restore src/lib/sessionCrypto.ts module (full AES-GCM encryption implementation)
- Fixes TypeScript compilation errors blocking Cloudflare Pages deployment
2026-02-12 23:07:44 +08:00

51 lines
1.3 KiB
TypeScript

import './polyfills';
// Production: Disable all console output (prevents seed recovery via console history)
if (import.meta.env.PROD) {
console.log = () => { };
console.error = () => { };
console.warn = () => { };
console.debug = () => { };
console.info = () => { };
console.trace = () => { };
console.time = () => { };
console.timeEnd = () => { };
}
// Development: Suppress OpenPGP.js AES cipher warnings
if (import.meta.env.DEV) {
const originalWarn = console.warn;
const originalError = console.error;
console.warn = (...args: any[]) => {
const msg = args[0]?.toString() || '';
if (msg.includes('AES-CBC') || msg.includes('AES-CTR') || msg.includes('authentication')) {
return;
}
originalWarn.apply(console, args);
};
console.error = (...args: any[]) => {
const msg = args[0]?.toString() || '';
if (msg.includes('AES-CBC') || msg.includes('AES-CTR') || msg.includes('authentication')) {
return;
}
originalError.apply(console, args);
};
}
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App'
if (import.meta.env.DEV) {
await import('./lib/sessionCrypto');
}
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)