Новые правки

This commit is contained in:
Web-serfer 2026-05-07 18:06:14 +05:00
parent 4900f81dcf
commit 8d83b9d2b4

View file

@ -1,4 +1,4 @@
import { createSignal, For, Show, onMount } from "solid-js"; import { createSignal, For, Show, onMount, createEffect } from "solid-js";
import CommentLock from "./CommentLock"; import CommentLock from "./CommentLock";
import CommentForm from "./CommentForm"; import CommentForm from "./CommentForm";
import type { CommentWithReplies, CommentRecord } from "../../../types/comments"; import type { CommentWithReplies, CommentRecord } from "../../../types/comments";
@ -14,7 +14,10 @@ interface CommentsProps {
} }
export default function Comments(props: CommentsProps) { export default function Comments(props: CommentsProps) {
const [isAuthenticated, setIsAuthenticated] = createSignal(!!props.isAuthorized); const isAuthFromSSR = props.isAuthorized ?? false;
console.log("[Comments] SSR isAuthorized:", isAuthFromSSR);
const [isAuthenticated, setIsAuthenticated] = createSignal(isAuthFromSSR);
console.log("[Comments] Initial isAuthenticated:", isAuthenticated());
const [currentUser, setCurrentUser] = createSignal<{ const [currentUser, setCurrentUser] = createSignal<{
id: string; id: string;
name: string; name: string;
@ -299,6 +302,11 @@ export default function Comments(props: CommentsProps) {
)} )}
</Show> </Show>
{/* DEBUG SSR */}
<div class="debug-ssr" style="background:magenta;color:white;padding:5px;margin:5px;font-size:12px;">
SSR isAuthorized: {String(props.isAuthorized)} | client isAuthenticated: {String(isAuthenticated())}
</div>
{isLoading() ? ( {isLoading() ? (
<div class="max-w-4xl mx-auto mt-12 pt-8 border-t border-gray-200"> <div class="max-w-4xl mx-auto mt-12 pt-8 border-t border-gray-200">
<div class="flex items-center gap-3 mb-8"> <div class="flex items-center gap-3 mb-8">