diff --git a/packages/status-js/src/client/community/handle-waku-message.ts b/packages/status-js/src/client/community/handle-waku-message.ts index 3fcae8c1..16505955 100644 --- a/packages/status-js/src/client/community/handle-waku-message.ts +++ b/packages/status-js/src/client/community/handle-waku-message.ts @@ -66,7 +66,7 @@ export function handleWakuMessage( return } - let success = false + client.wakuMessages.add(messageId) // decode, map and handle (events) try { @@ -78,8 +78,6 @@ export function handleWakuMessage( // handle (state and callback) community.handleDescription(decodedPayload) - success = true - break } @@ -99,8 +97,6 @@ export function handleWakuMessage( // handle community.chats.get(chatUuid)?.handleNewMessage(chatMessage) - success = true - break } @@ -114,8 +110,6 @@ export function handleWakuMessage( .get(chatUuid) ?.handleEditedMessage(messageId, decodedPayload.text) - success = true - break } @@ -127,8 +121,6 @@ export function handleWakuMessage( community.chats.get(chatUuid)?.handleDeletedMessage(messageId) - success = true - break } @@ -142,8 +134,6 @@ export function handleWakuMessage( .get(chatUuid) ?.handlePinnedMessage(messageId, decodedPayload.pinned) - success = true - break } @@ -161,23 +151,15 @@ export function handleWakuMessage( `0x${bytesToHex(publicKey)}` ) - success = true - break } default: - success = true - break } } catch { // protons-runtime throws when trying to decode invalid protocol buffers - success = true - } - - if (success) { - client.wakuMessages.add(messageId) + // eslint-disable-next-line no-empty } return