func onMediaCallDiagnosticsUpdated()

in AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Redux/Middleware/CallingMiddlewareHandler.swift [665:688]


    func onMediaCallDiagnosticsUpdated(state: AppState,
                                       dispatch: @escaping ActionDispatch,
                                       diagnisticModel: MediaDiagnosticModel) -> Task<Void, Never> {
        Task {
            switch diagnisticModel.diagnostic {
            case .speakingWhileMicrophoneIsMuted:
                if diagnisticModel.value {
                    dispatch(.toastNotificationAction(.showNotification(kind: .speakingWhileMicrophoneIsMuted)))
                } else {
                    dispatch(.toastNotificationAction(.dismissNotification))
                }
            case .cameraStartFailed:
                if diagnisticModel.value {
                    dispatch(.toastNotificationAction(.showNotification(kind: .cameraStartFailed)))
                }
            case .cameraStartTimedOut:
                if diagnisticModel.value {
                    dispatch(.toastNotificationAction(.showNotification(kind: .cameraStartTimedOut)))
                }
            default:
                break
            }
        }
    }