Skip to content

Commit

Permalink
Have duplicates filtering respect search text options.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Oct 1, 2024
1 parent 0cf11d0 commit 1f8cc41
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Spellbook/SpellFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ func filteredSpellList(state: SpellbookAppState) -> [Spell] {
// I'd rather avoid a second pass, but since linked spells won't necessarily
// have the same data, we can't generally know whether we need to filter a spell
// as a duplicate on the first pass
if hideDuplicates {
let isText = (state.searchQuery?.isEmpty) != nil
let applyFiltersToSearch = state.profile?.sortFilterStatus.applyFiltersToSearch ?? false
let searchTextOnly = isText && !applyFiltersToSearch
let doDuplicatesFilter = hideDuplicates && !searchTextOnly
if doDuplicatesFilter {
let prefer2024Spells = state.profile?.sortFilterStatus.prefer2024Spells ?? true
let rulesetToIgnore = prefer2024Spells ? Ruleset.Rules2014 : Ruleset.Rules2024
let duplicatesFilter = { (spell: Spell) in
Expand Down

0 comments on commit 1f8cc41

Please sign in to comment.