give unregistered people access to chat channels
This commit is contained in:
parent
6dc2084bc7
commit
a8232757b1
|
@ -108,7 +108,7 @@ const ChannelDropDown = ({
|
|||
if (channels[chatChannel]) {
|
||||
setChatChannelName(channels[chatChannel][0]);
|
||||
}
|
||||
}, [chatChannel]);
|
||||
}, [chatChannel, channels]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -167,14 +167,20 @@ const Chat = ({
|
|||
)))
|
||||
}
|
||||
</ul>
|
||||
{(ownName) ? (
|
||||
<div className="chatinput">
|
||||
<form
|
||||
className="chatinput"
|
||||
onSubmit={(e) => handleSubmit(e)}
|
||||
style={{ display: 'flex', flexDirection: 'row', height: '100%' }}
|
||||
style={{
|
||||
display: 'flex',
|
||||
}}
|
||||
>
|
||||
{(ownName) ? (
|
||||
<>
|
||||
<input
|
||||
style={{ flexGrow: 1, minWidth: 40 }}
|
||||
style={{
|
||||
flexGrow: 1,
|
||||
minWidth: 40,
|
||||
}}
|
||||
id={`chtipt-${windowId}`}
|
||||
value={inputMessage}
|
||||
onChange={(e) => dispatch(
|
||||
|
@ -192,23 +198,27 @@ const Chat = ({
|
|||
>
|
||||
‣
|
||||
</button>
|
||||
<ChannelDropDown
|
||||
setChatChannel={setChannel}
|
||||
chatChannel={chatChannel}
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div
|
||||
className="modallink"
|
||||
onClick={() => dispatch(showUserAreaModal())}
|
||||
style={{ textAlign: 'center', fontSize: 13 }}
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
fontSize: 13,
|
||||
flexGrow: 1,
|
||||
}}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
>
|
||||
{t`You must be logged in to chat`}
|
||||
</div>
|
||||
)}
|
||||
<ChannelDropDown
|
||||
setChatChannel={setChannel}
|
||||
chatChannel={chatChannel}
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -55,7 +55,7 @@ export default function chat(
|
|||
const keys = Object.keys(channels);
|
||||
for (let i = 0; i < keys.length; i += 1) {
|
||||
const cid = keys[i];
|
||||
if (channels[cid][1] === 0) {
|
||||
if (channels[cid][1] !== 0) {
|
||||
delete messages[cid];
|
||||
delete channels[cid];
|
||||
}
|
||||
|
|
|
@ -664,6 +664,7 @@ tr:nth-child(even) {
|
|||
.chatinput {
|
||||
height: 24px;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
}
|
||||
.chathead {
|
||||
display: flex;
|
||||
|
|
Loading…
Reference in New Issue
Block a user