start reporting an error on invalid topic id

This commit is contained in:
or-else
2018-04-15 14:06:03 -07:00
parent cd8f5a1b94
commit 6edaf16db8
+5 -1
View File
@@ -2158,7 +2158,9 @@
{this.state.tabSelected === "grp" ?
<NewTopicView.Group onSubmit={this.handleNewGroupSubmit} /> :
this.state.tabSelected === "byId" ?
<NewTopicView.ById onSubmit={this.handleGroupByID} /> :
<NewTopicView.ById
onSubmit={this.handleGroupByID}
onError={this.props.onError} /> :
<div className="flex-column">
<NewTopicView.SearchContacts type="p2p"
searchQuery={this.state.searchQuery}
@@ -2301,6 +2303,8 @@
var name = this.state.groupId.trim();
if (name.length > 3 && (name.substr(0, 3) == 'usr' || name.substr(0, 3) == 'grp')) {
this.props.onSubmit(name);
} else {
this.props.onError("Invalid ID", "err");
}
}
},