fix websocket connection stuff

This commit is contained in:
Arkaprabha Chakraborty
2025-11-01 22:16:15 +05:30
parent d392e1684b
commit 6849d6d266
5 changed files with 148 additions and 21 deletions

View File

@@ -4,20 +4,21 @@ import { useState, useEffect } from "react";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { TriangleAlert } from "lucide-react";
import { getCookie, setCookie } from "@/lib/cookies";
export const ContentWarningModal = () => {
const [showWarning, setShowWarning] = useState(false);
useEffect(() => {
// Check if user has already acknowledged the warning
const hasAcknowledged = localStorage.getItem('content-warning-acknowledged');
const hasAcknowledged = getCookie('osborne-cwa') === 'true';
if (!hasAcknowledged) {
setShowWarning(true);
}
}, []);
const handleAcknowledge = () => {
localStorage.setItem('content-warning-acknowledged', 'true');
setCookie('osborne-cwa', 'true', 365); // 1 year
setShowWarning(false);
};