From 3d5af69cbdb9820e5515424a38bd230c6f9e6504 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 8 Oct 2023 21:58:05 +0300 Subject: vnext: fix remaining unauthenticated components --- vnext/src/ui/Comment.js | 4 ++-- vnext/src/ui/PM.js | 2 +- vnext/src/ui/Thread.js | 4 ++-- vnext/src/ui/helpers/BubbleStyle.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'vnext/src') diff --git a/vnext/src/ui/Comment.js b/vnext/src/ui/Comment.js index 6ba34ff0..3a3f4429 100644 --- a/vnext/src/ui/Comment.js +++ b/vnext/src/ui/Comment.js @@ -53,7 +53,7 @@ export default function Comment({ msg, draft, active, setActive, onStartEditing, { msg.body && -
+

= 0) }} />

@@ -71,7 +71,7 @@ export default function Comment({ msg, draft, active, setActive, onStartEditing, { active === msg.rid && } - {visitor.uid > 0 && + {visitor && visitor.uid > 0 &&
{ visitor.uid > 0 ? ( diff --git a/vnext/src/ui/PM.js b/vnext/src/ui/PM.js index 3aa877b1..b0426ea3 100644 --- a/vnext/src/ui/PM.js +++ b/vnext/src/ui/PM.js @@ -12,7 +12,7 @@ function PM(props) {
  • -
    +

    diff --git a/vnext/src/ui/Thread.js b/vnext/src/ui/Thread.js index 61474153..4fc049c3 100644 --- a/vnext/src/ui/Thread.js +++ b/vnext/src/ui/Thread.js @@ -28,7 +28,7 @@ export default function Thread(props) { const [editing, setEditing] = useState(emptyMessage) const [visitor] = useVisitor() - const [hash] = useState(visitor.hash) + const [hash] = useState(visitor?.hash) const { mid } = params let loadReplies = useCallback(() => { @@ -131,7 +131,7 @@ export default function Thread(props) { { message.mid ? ( - {active === (message.rid || 0) && visitor.uid > 0 && Write a comment...} + {active === (message.rid || 0) && visitor && visitor.uid > 0 && Write a comment...} ) : ( diff --git a/vnext/src/ui/helpers/BubbleStyle.js b/vnext/src/ui/helpers/BubbleStyle.js index def60b62..3b21d1fb 100644 --- a/vnext/src/ui/helpers/BubbleStyle.js +++ b/vnext/src/ui/helpers/BubbleStyle.js @@ -5,7 +5,7 @@ */ export function chatItemStyle(me, msg) { const user = msg.user - const isMe = me.uid === user.uid + const isMe = me && me.uid === user.uid const alignment = isMe ? 'flex-end' : 'flex-start' return { padding: '3px 6px', -- cgit v1.2.3