- Fix warning on single case enum. - Remove unused subjects. - Fix a lint warning. - Remove unused success value. - Fix warning about position of try await. - Add a note about the common tracing configuration. - Show an indicator when resolving a send failure fails. - Make sure the whole row is clickable in the GlobalSearchScreen.
47 lines
1.1 KiB
Swift
47 lines
1.1 KiB
Swift
//
|
|
// Copyright 2022-2024 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
// Please see LICENSE in the repository root for full details.
|
|
//
|
|
|
|
import AVKit
|
|
import Foundation
|
|
|
|
enum CallScreenViewModelAction {
|
|
case pictureInPictureIsAvailable(AVPictureInPictureController)
|
|
case pictureInPictureStarted
|
|
case pictureInPictureStopped
|
|
case dismiss
|
|
}
|
|
|
|
struct CallScreenViewState: BindableState {
|
|
let messageHandler: String
|
|
let script: String?
|
|
var url: URL?
|
|
|
|
let certificateValidator: CertificateValidatorHookProtocol
|
|
|
|
var bindings = Bindings()
|
|
}
|
|
|
|
struct Bindings {
|
|
var javaScriptMessageHandler: ((Any) -> Void)?
|
|
var javaScriptEvaluator: ((String) async throws -> Any)?
|
|
var requestPictureInPictureHandler: (() async -> Result<Void, CallScreenError>)?
|
|
|
|
var alertInfo: AlertInfo<UUID>?
|
|
}
|
|
|
|
enum CallScreenViewAction {
|
|
case urlChanged(URL?)
|
|
case pictureInPictureIsAvailable(AVPictureInPictureController)
|
|
case navigateBack
|
|
case pictureInPictureWillStop
|
|
case endCall
|
|
}
|
|
|
|
enum CallScreenError: Error {
|
|
case pictureInPictureNotAvailable
|
|
}
|