crash on missing topic parameters, ranamed var for clarity
This commit is contained in:
@@ -35,7 +35,7 @@ class NewTopicView extends React.Component {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
tabSelected: 'p2p',
|
||||
tabSelected: 'find',
|
||||
searchQuery: null
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ class NewTopicView extends React.Component {
|
||||
}
|
||||
|
||||
handleContactSelected(uid) {
|
||||
if (this.state.tabSelected == 'p2p') {
|
||||
if (this.state.tabSelected == 'find') {
|
||||
HashNavigation.navigateTo(HashNavigation.removeUrlParam(window.location.hash, 'tab'));
|
||||
this.props.onCreateTopic(uid);
|
||||
}
|
||||
@@ -87,8 +87,8 @@ class NewTopicView extends React.Component {
|
||||
return (
|
||||
<div className="flex-column">
|
||||
<ul className="tabbar">
|
||||
<li className={this.state.tabSelected === "p2p" ? "active" : null}>
|
||||
<a href="#" data-id="p2p" onClick={this.handleTabClick}>
|
||||
<li className={this.state.tabSelected === "find" ? "active" : null}>
|
||||
<a href="#" data-id="find" onClick={this.handleTabClick}>
|
||||
<FormattedMessage id="tabtitle_find_user" defaultMessage="find"
|
||||
description="Tab title Find" />
|
||||
</a>
|
||||
@@ -116,7 +116,6 @@ class NewTopicView extends React.Component {
|
||||
onError={this.props.onError} /> :
|
||||
<div className="flex-column">
|
||||
<SearchContacts
|
||||
type="p2p"
|
||||
placeholder={search_placeholder}
|
||||
onSearchContacts={this.handleSearchContacts} />
|
||||
<ContactList
|
||||
|
||||
@@ -1235,8 +1235,10 @@ class TinodeWeb extends React.Component {
|
||||
params.desc = {defacs: {auth: DEFAULT_P2P_ACCESS_MODE}};
|
||||
} else {
|
||||
topicName = topicName || this.tinode.newGroupTopicName(isChannel);
|
||||
params.desc = {public: newTopicParams.public, private: {comment: newTopicParams.private}};
|
||||
params.tags = newTopicParams.tags;
|
||||
if (newTopicParams) {
|
||||
params.desc = {public: newTopicParams.public, private: {comment: newTopicParams.private}};
|
||||
params.tags = newTopicParams.tags;
|
||||
}
|
||||
}
|
||||
params._topicName = topicName;
|
||||
this.setState({newTopicParams: params}, () => {this.handleTopicSelected(topicName)});
|
||||
|
||||
Reference in New Issue
Block a user