Skip to content

Commit

Permalink
Fix list describing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv committed Jan 24, 2025
1 parent 9978e91 commit a8a66cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ struct DestinationDescriber: DestinationDescribing {

private func customListDescription(_ destination: UserSelectedRelays) -> String? {
// We only return a description for the list if the user has selected the
// entire list. If they have selected a subset of relays/locations from it,
// entire list. If they have only selected relays/locations from it,
// we show those as if they selected them from elsewhere.
guard
let customListSelection = destination.customListSelection,
let customList = customListRepository.fetch(by: customListSelection.listId),
customList.locations.count == destination.locations.count
customListSelection.isList,
let customList = customListRepository.fetch(by: customListSelection.listId)
else { return nil }
return customList.name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class DestinationDescriberTests: XCTestCase {
XCTAssertEqual(
describer.describe(.init(
locations: [.country("se")],
customListSelection: .init(listId: listid, isList: true)
customListSelection: .init(listId: listid, isList: false)
)),
"Sweden"
)
Expand Down

0 comments on commit a8a66cc

Please sign in to comment.