From 714391b8074f8294c28c03845ef6597d6d73467a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 5 Jan 2024 12:09:12 -0600 Subject: [PATCH] SearchStore: only use the external search if the socket is open --- src/storages/search-store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storages/search-store.ts b/src/storages/search-store.ts index 30e6ba1..5afba6d 100644 --- a/src/storages/search-store.ts +++ b/src/storages/search-store.ts @@ -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);