remove textarea for unauthenticated users
This commit is contained in:
parent
939c0d8784
commit
24f7f73af2
1 changed files with 6 additions and 6 deletions
|
@ -171,15 +171,15 @@ export default function Home() {
|
|||
|
||||
function onConnect() {
|
||||
setConnected(true);
|
||||
if (token != null)
|
||||
if (token != null) {
|
||||
socket.emit('SIG_CHAT_JOIN', { token }, joinChatRes);
|
||||
else
|
||||
setTextBox(<div className={styles.textBox}>
|
||||
<textarea rows={2} className={styles.textBoxInput} ref={chatInput}></textarea>
|
||||
<button className={styles.textBoxButton} onClick={() => socket.emit('SIG_CHAT_MESSAGE', { message: chatInput.current?.value }, messageChatRes)}>Send</button>
|
||||
</div>)
|
||||
} else
|
||||
socket.emit('SIG_CHAT_CHANNELS', {}, channelsChatRes);
|
||||
|
||||
setTextBox(<div className={styles.textBox}>
|
||||
<textarea rows={2} className={styles.textBoxInput} ref={chatInput}></textarea>
|
||||
<button className={styles.textBoxButton} onClick={() => socket.emit('SIG_CHAT_MESSAGE', { message: chatInput.current?.value }, messageChatRes)}>Send</button>
|
||||
</div>)
|
||||
Message.current = (message:MessageType) => {
|
||||
let user;
|
||||
user = usersRef.current.find(x => x.id == message.user);
|
||||
|
|
Loading…
Reference in a new issue