Skip to content

Commit 876bfe5

Browse files
committed
Fix compilation error
1 parent b2f685f commit 876bfe5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Sources/StreamVideo/WebRTC/v2/WebRTCAuthenticator.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ struct WebRTCAuthenticator: WebRTCAuthenticating {
8888
/// - Finally, applies the determined call settings to the state adapter.
8989
let initialCallSettings = await coordinator.stateAdapter.initialCallSettings
9090
let remoteCallSettings = CallSettings(response.call.settings)
91-
var callSettings = initialCallSettings ?? remoteCallSettings
92-
if
93-
coordinator.stateAdapter.audioSession.currentRoute.isExternal,
94-
callSettings.speakerOn
95-
{
96-
callSettings = callSettings.withUpdatedSpeakerState(false)
97-
}
91+
let callSettings = {
92+
var result = initialCallSettings ?? remoteCallSettings
93+
if
94+
coordinator.stateAdapter.audioSession.currentRoute.isExternal,
95+
result.speakerOn
96+
{
97+
result = result.withUpdatedSpeakerState(false)
98+
}
99+
return result
100+
}()
101+
98102
await coordinator
99103
.stateAdapter
100104
.enqueueCallSettings { _ in callSettings }

0 commit comments

Comments
 (0)