fix: room case-insensitivity
This commit is contained in:
parent
d20466d10f
commit
fd1de29781
|
@ -25,6 +25,7 @@
|
|||
.channels__joinText {
|
||||
flex-grow: 1;
|
||||
padding-left: 0.25em;
|
||||
text-transform: lowercase;
|
||||
width: 0%;
|
||||
&:focus {
|
||||
font-size: 1.5em;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import './chat.scss';
|
||||
|
||||
import {goBack, replace} from 'connected-react-router';
|
||||
import {goBack, push, replace} from 'connected-react-router';
|
||||
import React, {useEffect, useRef} from 'react';
|
||||
import {useSelector, useDispatch} from 'react-redux';
|
||||
|
||||
|
@ -28,12 +28,17 @@ export default function Chat() {
|
|||
useEffect(() => {
|
||||
if (!allowedUser) {
|
||||
dispatch(historyLength > 1 ? goBack() : replace('/'));
|
||||
return;
|
||||
}
|
||||
if (channel !== channel.toLowerCase()) {
|
||||
dispatch(push(`/chat${channel.toLowerCase()}`));
|
||||
return;
|
||||
}
|
||||
if (!hasChannel && validateChannel(channel)) {
|
||||
dispatch(submitJoin({channel, id: user.id}));
|
||||
dispatch(submitJoin({channel: channel.toLowerCase(), id: user.id}));
|
||||
}
|
||||
});
|
||||
if (!allowedUser) {
|
||||
if (!allowedUser || !hasChannel) {
|
||||
return null;
|
||||
}
|
||||
let origin;
|
||||
|
|
Loading…
Reference in New Issue
Block a user