TF-3621 Fix search return wrong result if searching with option "Doesn't have"

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-04-08 14:53:21 +07:00
committed by Dat H. Pham
parent 821a1ce951
commit 2236c0eb01
2 changed files with 21 additions and 4 deletions
@@ -109,9 +109,6 @@ class SearchEmailFilter with EquatableMixin, OptionParamMixin {
from: from.length == 1
? from.first
: null,
notKeyword: notKeyword.length == 1
? notKeyword.first
: null,
hasKeyword: hasKeyword.length == 1
? hasKeyword.first
: null,
@@ -127,7 +124,7 @@ class SearchEmailFilter with EquatableMixin, OptionParamMixin {
Operator.OR,
from.map((e) => EmailFilterCondition(from: e)).toSet(),
),
if (notKeyword.length > 1)
if (notKeyword.isNotEmpty)
LogicFilterOperator(
Operator.NOT,
notKeyword.map((e) => EmailFilterCondition(text: e)).toSet(),