Harden onion boot flow and deepen site surfaces
Add persistent onion key backup and restore, improve startup resilience, and flesh out the major site verticals with richer navigation, search coverage, and operator documentation. Made-with: Cursor
This commit is contained in:
53
app/root-layout-client.tsx
Normal file
53
app/root-layout-client.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect, useCallback } from "react";
|
||||
import SecretLayer from "@/components/SecretLayer";
|
||||
import DDoSProtection from "@/components/DDoSProtection";
|
||||
import OnionDisclosureBar from "@/components/OnionDisclosureBar";
|
||||
import HubChatterPublicStrip from "@/components/HubChatterPublicStrip";
|
||||
import AppProviders from "@/components/AppProviders";
|
||||
import GlobalFakeSiteFooter from "@/components/GlobalFakeSiteFooter";
|
||||
|
||||
export default function RootLayoutClient({ children }: { children: React.ReactNode }) {
|
||||
const [isProtected, setIsProtected] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
const hasSeenDDoS = sessionStorage.getItem("ddos_verified");
|
||||
if (hasSeenDDoS) {
|
||||
setIsProtected(false);
|
||||
}
|
||||
} catch {
|
||||
// sessionStorage blocked (rare) — still allow progress overlay to complete
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleComplete = useCallback(() => {
|
||||
try {
|
||||
sessionStorage.setItem("ddos_verified", "true");
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
setIsProtected(false);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{isProtected ? (
|
||||
<DDoSProtection onComplete={handleComplete} />
|
||||
) : (
|
||||
<>
|
||||
<AppProviders>
|
||||
<div className="flex min-h-screen flex-col">
|
||||
<div className="flex-1">{children}</div>
|
||||
<GlobalFakeSiteFooter />
|
||||
</div>
|
||||
</AppProviders>
|
||||
<HubChatterPublicStrip />
|
||||
<SecretLayer />
|
||||
<OnionDisclosureBar />
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user