Skip to content

Commit

Permalink
[Fix]Sorting comparators for fullscreen layout and PiP
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Dec 3, 2024
1 parent 2ee1c89 commit bb1c1a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Sources/StreamVideo/Utils/Sorting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ public typealias StreamSortComparator<Value> = (Value, Value) -> ComparisonResul
public let defaultComparators: [StreamSortComparator<CallParticipant>] = [
pinned,
screensharing,
ifInvisible(combineComparators([
combineComparators([
dominantSpeaker,
isSpeaking,
isSpeaking,
publishingVideo,
publishingAudio
])),
]),
ifInvisible(userId)
]

Expand Down
5 changes: 3 additions & 2 deletions StreamVideoTests/Utils/Sorting_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,8 @@ final class Sorting_Tests: XCTestCase {
)
}

func test_defaultComparators_someSpeakingWhileDominantSpeakerIsVisible_orderDoesNotChange() {
func test_defaultComparators_someSpeakingWhileDominantSpeakerIsVisible_orderSetsToShowDominanFirstAndTheOthersSortedBasedOnOtherCriteria(
) {
let combined = combineComparators(defaultComparators)

assertSort(
Expand Down Expand Up @@ -733,7 +734,7 @@ final class Sorting_Tests: XCTestCase {
)
],
comparator: combined,
expectedTransformer: { [$0[0], $0[1], $0[2], $0[3]] }
expectedTransformer: { [$0[3], $0[0], $0[1], $0[2]] }
)
}

Expand Down

0 comments on commit bb1c1a6

Please sign in to comment.