refactor: consolidate contact API logic and enhance error handling
- Migrate contact API from route.tsx to route.ts for improved organization. - Implement filtering, pagination, and rate limiting for GET and POST requests. - Enhance error handling for database operations, including graceful handling of missing tables. - Validate input fields and email format in POST requests to ensure data integrity.
This commit is contained in:
@@ -8,6 +8,7 @@ export default function KernelPanic404() {
|
||||
const inputContainerRef = useRef<HTMLDivElement>(null);
|
||||
const overlayRef = useRef<HTMLDivElement>(null);
|
||||
const bodyRef = useRef<HTMLDivElement>(null); // We'll use a wrapper div instead of document.body for some effects if possible, but strict effects might need body.
|
||||
const bootStartedRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
/* --- SYSTEM CORE --- */
|
||||
@@ -20,6 +21,10 @@ export default function KernelPanic404() {
|
||||
const body = document.body;
|
||||
|
||||
if (!output || !input || !inputContainer || !overlay) return;
|
||||
|
||||
// Prevent double initialization - check if boot already started or output has content
|
||||
if (bootStartedRef.current || output.children.length > 0) return;
|
||||
bootStartedRef.current = true;
|
||||
|
||||
let audioCtx: AudioContext | null = null;
|
||||
let systemFrozen = false;
|
||||
|
||||
Reference in New Issue
Block a user