in AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Error/ErrorInfoViewModel.swift [43:85]
func update(errorState: ErrorState) {
let errorType = errorState.internalError
if errorType == .captionsNotActive ||
errorType == .captionsStartFailedCallNotConnected ||
errorType == .captionsStartFailedSpokenLanguageNotSupported {
return
}
guard let errorType = errorType else {
// if no error, hide banner
isDisplayed = false
return
}
guard errorType != previousErrorType else {
// if new error is the same as the previous one
// do nothing
return
}
previousErrorType = errorType
isDisplayed = true
switch errorType {
case .callJoinFailed:
title = localizationProvider.getLocalizedString(.snackBarErrorJoinCall)
case .callEndFailed:
title = localizationProvider.getLocalizedString(.snackBarErrorCallEnd)
case .callEvicted:
title = localizationProvider.getLocalizedString(.snackBarErrorCallEvicted)
case .callDenied:
title = localizationProvider.getLocalizedString(.snackBarErrorCallDenied)
case .cameraOnFailed:
title = localizationProvider.getLocalizedString(.snackBarErrorCameraOnFailed)
case .callJoinConnectionFailed:
title = localizationProvider.getLocalizedString(.snackBarErrorConnectionError)
case .micNotAvailable:
title = localizationProvider.getLocalizedString(.snackBarErrorOnHoldTitle) + "\n" +
localizationProvider.getLocalizedString(.snackBarErrorOnHoldSubtitle) + "."
default:
title = localizationProvider.getLocalizedString(.snackBarError)
}
}