diff --git a/src/app/chat/page.tsx b/src/app/chat/page.tsx index fd6a16c..97c68cb 100644 --- a/src/app/chat/page.tsx +++ b/src/app/chat/page.tsx @@ -113,7 +113,7 @@ export default function Home() { /* SECT: LHUA; Lord help us all these ones */ const [ textBox, setTextBox ] = useState(null); let Message = useRef<(message:MessageType) => React.ReactNode>(() => <>); - const [, forceUpdate] = useState({}); + const [ affectedByUpdate, forceUpdate ] = useState({}); const externCachedUsers = useRef(new Map()); /* END_SECT LHUA; */ @@ -169,6 +169,8 @@ export default function Home() { if (token != null) socket.emit('SIG_CHAT_JOIN', { token }, joinChatRes); + socket.emit('SIG_CHAT_CHANNELS', {}, channelsChatRes); + setTextBox(
@@ -195,7 +197,9 @@ export default function Home() { const timeSent = new Date(message.timestamp * 1000).toLocaleTimeString(); return

- {user?.username}@{user?.instance} + {user?.id != null ? + {user?.username}@{user?.instance} + : Fetching user...} {" "} socket.emit('SIG_CHAT_RMMESSAGE', { messageId: message.id }, rmmessageChatRes)} className={styles.deleteButton}> @@ -331,7 +335,6 @@ export default function Home() { setError(type, spec, data); } else { setWhoAmI(data); - socket.emit('SIG_CHAT_CHANNELS', {}, channelsChatRes); } } @@ -385,7 +388,7 @@ export default function Home() {

Tested on Discord, GitHub, Mastodon, GoToSocial, Pleroma, and Misskey

); - }, [messages]); + }, [affectedByUpdate, messages]); return (