diff --git a/src/webapp.jsx b/src/webapp.jsx
index 01dbf738..3a01cfca 100644
--- a/src/webapp.jsx
+++ b/src/webapp.jsx
@@ -1694,7 +1694,6 @@ class SidepanelView extends React.Component {
view === 'newtpk' ?
:
0) {
- this.setState({edited: true});
- this.props.onSearchContacts(query);
- } else if (this.props.searchQuery) {
- this.props.onSearchContacts(Tinode.DEL_CHAR);
- }
+ this.setState({edited: (query.length > 0)});
+ this.props.onSearchContacts(query.length > 0 ? query : Tinode.DEL_CHAR);
}
handleClear() {
- if (this.state.edited || this.state.search) {
+ if (this.state.edited) {
this.props.onSearchContacts(Tinode.DEL_CHAR);
}
this.setState({search: '', edited: false});
@@ -4402,7 +4394,6 @@ class TinodeWeb extends React.Component {
contextMenuParams: null,
contextMenuItems: [],
- contactsSearchQuery: '',
// Chats as shown in the ContactsView
chatList: [],
// Contacts returned by a search query.
@@ -4816,7 +4807,6 @@ class TinodeWeb extends React.Component {
tnInitFind() {
let fnd = this.tinode.getFndTopic();
if (fnd.isSubscribed()) {
- this.setState({contactsSearchQuery: ''});
this.tnFndSubsUpdated();
} else {
fnd.onSubsUpdated = this.tnFndSubsUpdated;
@@ -4843,7 +4833,6 @@ class TinodeWeb extends React.Component {
*/
handleSearchContacts(query) {
var fnd = this.tinode.getFndTopic();
- this.setState({contactsSearchQuery: query == Tinode.DEL_CHAR ? '' : query});
fnd.setMeta({desc: {public: query}}).then((ctrl) => {
return fnd.getMeta(fnd.startMetaQuery().withSub().build());
}).catch((err) => {
@@ -5305,7 +5294,6 @@ class TinodeWeb extends React.Component {
onValidateCredentials={this.handleValidateCredentialsRequest}
onInitFind={this.tnInitFind}
- contactsSearchQuery={this.state.contactsSearchQuery}
searchResults={this.state.searchResults}
onSearchContacts={this.handleSearchContacts}