File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Sources/StreamVideoSwiftUI Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
5
5
# Upcoming
6
6
7
- ### 🔄 Changed
7
+ ### 🐞 Fixed
8
+ - Fix ringing flow issues. [ #792 ] ( https://github.com/GetStream/stream-video-swift/pull/792 )
8
9
9
10
# [ 1.21.1] ( https://github.com/GetStream/stream-video-swift/releases/tag/1.21.1 )
10
11
_ April 25, 2025_
Original file line number Diff line number Diff line change @@ -764,6 +764,9 @@ open class CallViewModel: ObservableObject {
764
764
// TODO: implement holding a call.
765
765
if callingState == . idle && isAppActive {
766
766
setCallingState ( . incoming( incomingCall) )
767
+ /// We start the ringing timer, so we can cancel when the timeout
768
+ /// is over.
769
+ startTimer ( timeout: incomingCall. timeout)
767
770
}
768
771
}
769
772
case . accepted:
@@ -836,15 +839,16 @@ open class CallViewModel: ObservableObject {
836
839
837
840
switch callingState {
838
841
case let . incoming( incomingCall) where event. callCid == callCid ( from: incomingCall. id, callType: incomingCall. type) :
839
- /// If the call that was rejected is the incoming call we are presenting, then we reject
840
- /// and set the activeCall to the current one in order to reset the callingState to
841
- /// inCall or idle.
842
- Task {
843
- _ = try ? await streamVideo
844
- . call ( callType: incomingCall. type, callId: incomingCall. id)
845
- . reject ( )
846
- setActiveCall ( call)
842
+ let isCurrentUserRejection = event. user? . id == streamVideo. user. id
843
+ let isCallCreatorRejection = event. user? . id == incomingCall. caller. id
844
+
845
+ guard
846
+ ( isCurrentUserRejection || isCallCreatorRejection)
847
+ else {
848
+ return
847
849
}
850
+
851
+ setActiveCall ( call)
848
852
case . outgoing where call? . cId == event. callCid:
849
853
guard let outgoingCall = call else {
850
854
return
You can’t perform that action at this time.
0 commit comments