mirror of
https://github.com/urbit/shrub.git
synced 2024-12-02 21:34:04 +03:00
update new chat validation
This commit is contained in:
parent
dc673e4bb4
commit
e2c053766a
@ -69,11 +69,10 @@ export class NewScreen extends Component {
|
|||||||
onClickCreate() {
|
onClickCreate() {
|
||||||
const { props, state } = this;
|
const { props, state } = this;
|
||||||
|
|
||||||
let invalidChara = new RegExp(/[^a-z0-9/-]/);
|
let validChar = /^[a-z0-9~_.-]*$/;
|
||||||
|
|
||||||
let invalid = (
|
let invalid = (
|
||||||
(!state.idName) || (state.idName.startsWith("/")) ||
|
(!state.idName) || (!validChara.test(state.idName))
|
||||||
(state.idName.includes("//")) || (invalidChara.test(state.idName))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (invalid) {
|
if (invalid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user