SearchStore: only use the external search if the socket is open

This commit is contained in:
Alex Gleason 2024-01-05 12:09:12 -06:00
parent 4e6549407e
commit 714391b807
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class SearchStore implements EventStore {
this.#debug('REQ', JSON.stringify(filters));
const query = filters[0]?.search;
if (this.#relay) {
if (this.#relay && this.#relay.socket.readyState === WebSocket.OPEN) {
this.#debug(`Searching for "${query}" at ${this.#relay.socket.url}...`);
const sub = this.#relay.req(filters, opts);