Spaces:
Running
Running
Reupload OmniDev clean version
Browse files- app/layout.tsx +3 -1
- components/iframe-detector/index.tsx +5 -0
app/layout.tsx
CHANGED
|
@@ -113,7 +113,9 @@ export default async function RootLayout({
|
|
| 113 |
<body
|
| 114 |
className={`${inter.variable} ${ptSans.variable} antialiased bg-black dark h-[100dvh] overflow-hidden`}
|
| 115 |
>
|
| 116 |
-
|
|
|
|
|
|
|
| 117 |
<Toaster richColors position="bottom-center" />
|
| 118 |
<TanstackContext>
|
| 119 |
<AppContext me={data}>
|
|
|
|
| 113 |
<body
|
| 114 |
className={`${inter.variable} ${ptSans.variable} antialiased bg-black dark h-[100dvh] overflow-hidden`}
|
| 115 |
>
|
| 116 |
+
{((process.env.DISABLE_IFRAME_WARNING || process.env.NEXT_PUBLIC_DISABLE_IFRAME_WARNING) !== 'true') && (
|
| 117 |
+
<IframeDetector />
|
| 118 |
+
)}
|
| 119 |
<Toaster richColors position="bottom-center" />
|
| 120 |
<TanstackContext>
|
| 121 |
<AppContext me={data}>
|
components/iframe-detector/index.tsx
CHANGED
|
@@ -4,6 +4,11 @@ import { useEffect, useState } from "react";
|
|
| 4 |
import IframeWarningModal from "./modal";
|
| 5 |
|
| 6 |
export default function IframeDetector() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
const [showWarning, setShowWarning] = useState(false);
|
| 8 |
|
| 9 |
useEffect(() => {
|
|
|
|
| 4 |
import IframeWarningModal from "./modal";
|
| 5 |
|
| 6 |
export default function IframeDetector() {
|
| 7 |
+
// Allow disabling entirely via env
|
| 8 |
+
if (process.env.NEXT_PUBLIC_DISABLE_IFRAME_WARNING === 'true') {
|
| 9 |
+
return null;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
const [showWarning, setShowWarning] = useState(false);
|
| 13 |
|
| 14 |
useEffect(() => {
|