refactoring completed
This commit is contained in:
+3
-20
@@ -1672,9 +1672,7 @@ class SidepanelView extends React.Component {
|
|||||||
chatList={this.props.chatList}
|
chatList={this.props.chatList}
|
||||||
showContextMenu={this.props.showContextMenu}
|
showContextMenu={this.props.showContextMenu}
|
||||||
messageSounds={this.props.messageSounds}
|
messageSounds={this.props.messageSounds}
|
||||||
onTopicSelected={this.props.onTopicSelected}
|
onTopicSelected={this.props.onTopicSelected} /> :
|
||||||
onAcsChange={this.props.onAcsChange}
|
|
||||||
onOnlineChange={this.props.onOnlineChange} /> :
|
|
||||||
|
|
||||||
view === 'newtpk' ?
|
view === 'newtpk' ?
|
||||||
<NewTopicView
|
<NewTopicView
|
||||||
@@ -4273,8 +4271,6 @@ class TinodeWeb extends React.Component {
|
|||||||
this.tnFndSubsUpdated = this.tnFndSubsUpdated.bind(this);
|
this.tnFndSubsUpdated = this.tnFndSubsUpdated.bind(this);
|
||||||
this.handleSearchContacts = this.handleSearchContacts.bind(this);
|
this.handleSearchContacts = this.handleSearchContacts.bind(this);
|
||||||
this.handleTopicSelected = this.handleTopicSelected.bind(this);
|
this.handleTopicSelected = this.handleTopicSelected.bind(this);
|
||||||
this.handleTopicSelectedOnline = this.handleTopicSelectedOnline.bind(this);
|
|
||||||
this.handleTopicSelectedAcs = this.handleTopicSelectedAcs.bind(this);
|
|
||||||
this.handleHideMessagesView = this.handleHideMessagesView.bind(this);
|
this.handleHideMessagesView = this.handleHideMessagesView.bind(this);
|
||||||
this.handleSendMessage = this.handleSendMessage.bind(this);
|
this.handleSendMessage = this.handleSendMessage.bind(this);
|
||||||
this.handleNewAccount = this.handleNewAccount.bind(this);
|
this.handleNewAccount = this.handleNewAccount.bind(this);
|
||||||
@@ -4633,7 +4629,7 @@ class TinodeWeb extends React.Component {
|
|||||||
} else if (what == "msg") {
|
} else if (what == "msg") {
|
||||||
// New message received
|
// New message received
|
||||||
// Skip update if the topic is currently open, otherwise the badge will annoyingly flash.
|
// Skip update if the topic is currently open, otherwise the badge will annoyingly flash.
|
||||||
if (this.this.topicSelected !== cont.topic) {
|
if (this.this.topicSelected != cont.topic) {
|
||||||
if (this.state.messageSounds) {
|
if (this.state.messageSounds) {
|
||||||
POP_SOUND.play();
|
POP_SOUND.play();
|
||||||
}
|
}
|
||||||
@@ -4678,7 +4674,7 @@ class TinodeWeb extends React.Component {
|
|||||||
this.state.tinode.getMeTopic().contacts((c) => {
|
this.state.tinode.getMeTopic().contacts((c) => {
|
||||||
newState.chatList.push(c);
|
newState.chatList.push(c);
|
||||||
if (this.state.topicSelected == c.topic) {
|
if (this.state.topicSelected == c.topic) {
|
||||||
newState.topicSelected = c.online;
|
newState.topicSelectedOnline = c.online;
|
||||||
newState.topicSelectedAcs = c.acs;
|
newState.topicSelectedAcs = c.acs;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -4688,7 +4684,6 @@ class TinodeWeb extends React.Component {
|
|||||||
merged[c.topic] = c;
|
merged[c.topic] = c;
|
||||||
}
|
}
|
||||||
newState.searchableContacts = Object.values(merged);
|
newState.searchableContacts = Object.values(merged);
|
||||||
console.log("Resetting contact list 2", newState);
|
|
||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4774,16 +4769,6 @@ class TinodeWeb extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleTopicSelectedOnline(online) {
|
|
||||||
if (typeof online == 'boolean') {
|
|
||||||
this.setState({topicSelectedOnline: online});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Permissions of a currently selected topic have been updated by server.
|
|
||||||
handleTopicSelectedAcs(acs) {
|
|
||||||
this.setState({topicSelectedAcs: acs});
|
|
||||||
}
|
|
||||||
|
|
||||||
// In mobile view user requested to show sidepanel
|
// In mobile view user requested to show sidepanel
|
||||||
handleHideMessagesView() {
|
handleHideMessagesView() {
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -5141,8 +5126,6 @@ class TinodeWeb extends React.Component {
|
|||||||
onNewTopic={this.handleNewTopic}
|
onNewTopic={this.handleNewTopic}
|
||||||
onLogout={this.handleLogout}
|
onLogout={this.handleLogout}
|
||||||
onCancel={this.handleSidepanelCancel}
|
onCancel={this.handleSidepanelCancel}
|
||||||
onOnlineChange={this.handleTopicSelectedOnline}
|
|
||||||
onAcsChange={this.handleTopicSelectedAcs}
|
|
||||||
onError={this.handleError}
|
onError={this.handleError}
|
||||||
onValidateCredentials={this.handleValidateCredentialsRequest}
|
onValidateCredentials={this.handleValidateCredentialsRequest}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user