Skip to content

Commit

Permalink
Lowercase party and search strings to ignore case (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emirlol committed Jan 23, 2024
1 parent 22bc9e7 commit 2a447a5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void setEntries(List<PartyEntry> partyEntries) {

public void updateDisplay() {
List<PartyEntry> entries = new ArrayList<>(partyEntries);
entries.removeIf(partyEntry -> !partyEntry.note.contains(search) && !(partyEntry instanceof PartyEntry.YourParty));
entries.removeIf(partyEntry -> !partyEntry.note.toLowerCase().contains(search) && !(partyEntry instanceof PartyEntry.YourParty));
entries.sort(Comparator.comparing(PartyEntry::isLocked));
entries.sort(Comparator.comparing(partyEntry -> !(partyEntry instanceof PartyEntry.YourParty)));
if (entries.isEmpty() && !partyEntries.isEmpty()) {
Expand All @@ -63,7 +63,7 @@ public void updateDisplay() {
}

public void setSearch(String s) {
search = s;
search = s.toLowerCase();
updateDisplay();
}

Expand Down

0 comments on commit 2a447a5

Please sign in to comment.