From ba290354138fa32fc6f948651378f40c674c526a Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 2 Jul 2024 18:43:28 -0300 Subject: [PATCH] refactor: put conditional into just one line --- src/controllers/nostr/relay.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/controllers/nostr/relay.ts b/src/controllers/nostr/relay.ts index f4193379..4d8ab2cb 100644 --- a/src/controllers/nostr/relay.ts +++ b/src/controllers/nostr/relay.ts @@ -77,9 +77,7 @@ function connectStream(socket: WebSocket) { send(['EVENT', subId, event]); } } catch (e) { - if ( - e instanceof RelayError - ) { + if (e instanceof RelayError) { send(['CLOSED', subId, e.message]); } else { send(['CLOSED', subId, 'error: something went wrong']);