use search relays for search

This commit is contained in:
Martti Malmi 2023-03-30 15:41:48 +03:00
parent c08b73af30
commit cddf9d2d64
2 changed files with 7 additions and 9 deletions

View File

@ -116,7 +116,13 @@ const PubSub = {
},
subscribeRelayPool(filter: Filter, sinceLastOpened: boolean) {
let relays: any = Array.from(Relays.relays.keys());
let relays: any;
if (filter.keywords) {
// search relays
relays = Array.from(Relays.searchRelays.keys());
} else {
relays = Array.from(Relays.relays.keys());
}
// if any of filters[] doesn't have authors, we need to define default relays
/*
if (!filter.authors) {

View File

@ -35,13 +35,6 @@ class Feed extends View {
localState.get('filters').get('group').on(this.inject());
}
filter(msg) {
if (this.state.searchTerm) {
return msg.text && msg.text.toLowerCase().indexOf(this.state.searchTerm) > -1;
}
return true;
}
renderView() {
const s = this.state;
let path = this.props.index || 'msgs';
@ -64,7 +57,6 @@ class Feed extends View {
: html` <${OnboardingNotification} /> `}
<${FeedComponent}
scrollElement=${this.scrollElement.current}
filter=${s.searchTerm && ((m) => this.filter(m))}
keyword=${s.searchTerm}
key=${this.props.index || 'feed'}
index=${this.props.index}