From afeadd5bfb68bd9bc0ba7333e56a4356f64fab5f Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 19 Aug 2023 15:05:00 +0200 Subject: [PATCH] Make antennas also match on CW text, resolves #117 --- packages/backend/src/misc/check-hit-antenna.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/misc/check-hit-antenna.ts b/packages/backend/src/misc/check-hit-antenna.ts index 1ff09d629..b914450a3 100644 --- a/packages/backend/src/misc/check-hit-antenna.ts +++ b/packages/backend/src/misc/check-hit-antenna.ts @@ -101,8 +101,8 @@ export async function checkHitAntenna( const matched = keywords.some((and) => and.every((keyword) => antenna.caseSensitive - ? note.text!.includes(keyword) - : note.text!.toLowerCase().includes(keyword.toLowerCase()), + ? note.text!.includes(keyword) || note.cw?.includes(keyword) + : note.text!.toLowerCase().includes(keyword.toLowerCase()) || note.cw?.toLowerCase().includes(keyword.toLowerCase()), ), ); @@ -120,8 +120,8 @@ export async function checkHitAntenna( const matched = excludeKeywords.some((and) => and.every((keyword) => antenna.caseSensitive - ? note.text!.includes(keyword) - : note.text!.toLowerCase().includes(keyword.toLowerCase()), + ? note.text!.includes(keyword) || note.cw?.includes(keyword) + : note.text!.toLowerCase().includes(keyword.toLowerCase()) || note.cw?.toLowerCase().includes(keyword.toLowerCase()), ), );