mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
- 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
51 lines
1.3 KiB
TypeScript
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>,
|
|
)
|