Skip to content

Commit df0d607

Browse files
committed
autocomplete [nfc]: Mention why the inequality check is needed
This helps imply why we don't have the check when displayName is null Signed-off-by: Zixuan James Li <[email protected]>
1 parent 2795e98 commit df0d607

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/model/autocomplete.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,8 @@ class TopicAutocompleteQuery extends AutocompleteQuery {
947947
return store.realmEmptyTopicDisplayName.toLowerCase()
948948
.contains(raw.toLowerCase());
949949
}
950+
// This checks for inequality because there is nothing to autocomplete to
951+
// when `raw` already matches the topic exactly.
950952
return topic.displayName != raw
951953
// ignore: unnecessary_non_null_assertion // null topic names soon to be enabled
952954
&& topic.displayName!.toLowerCase().contains(raw.toLowerCase());

0 commit comments

Comments
 (0)