Skip to content

Commit

Permalink
[Fix]Sorting comparators for fullscreen layout and PiP (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis authored Dec 3, 2024
1 parent 2ee1c89 commit 3dfc2e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### 🐞 Fixed
- By observing the `CallKitPushNotificationAdapter.deviceToken` you will be notified with an empty `deviceToken` value, once the object unregister push notifications. [#608](https://github.com/GetStream/stream-video-swift/pull/608)
- When a call you receive a ringing while the app isn't running (and the screen is locked), websocket connection wasn't recovered. [#600](https://github.com/GetStream/stream-video-swift/pull/600)
- Sorting order on Fullscreen Layout and Picture-in-Picture wasn't respecting dominant speaker change. [#613](https://github.com/GetStream/stream-video-swift/pull/613)

# [1.14.1](https://github.com/GetStream/stream-video-swift/releases/tag/1.14.1)
_November 12, 2024_
Expand Down
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 3dfc2e2

Please sign in to comment.