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() {
|
function onConnect() {
|
||||||
setConnected(true);
|
setConnected(true);
|
||||||
if (token != null)
|
if (token != null) {
|
||||||
socket.emit('SIG_CHAT_JOIN', { token }, joinChatRes);
|
socket.emit('SIG_CHAT_JOIN', { token }, joinChatRes);
|
||||||
else
|
|
||||||
socket.emit('SIG_CHAT_CHANNELS', {}, channelsChatRes);
|
|
||||||
|
|
||||||
setTextBox(<div className={styles.textBox}>
|
setTextBox(<div className={styles.textBox}>
|
||||||
<textarea rows={2} className={styles.textBoxInput} ref={chatInput}></textarea>
|
<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>
|
<button className={styles.textBoxButton} onClick={() => socket.emit('SIG_CHAT_MESSAGE', { message: chatInput.current?.value }, messageChatRes)}>Send</button>
|
||||||
</div>)
|
</div>)
|
||||||
|
} else
|
||||||
|
socket.emit('SIG_CHAT_CHANNELS', {}, channelsChatRes);
|
||||||
|
|
||||||
Message.current = (message:MessageType) => {
|
Message.current = (message:MessageType) => {
|
||||||
let user;
|
let user;
|
||||||
user = usersRef.current.find(x => x.id == message.user);
|
user = usersRef.current.find(x => x.id == message.user);
|
||||||
|
|
Loading…
Reference in a new issue