// // Copyright 2025 Element Creations Ltd. // Copyright 2021-2025 New Vector Ltd. // // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial. // Please see LICENSE files in the repository root for full details. // import Combine import SwiftUI typealias AnalyticsPromptScreenViewModelType = StateStoreViewModelV2 class AnalyticsPromptScreenViewModel: AnalyticsPromptScreenViewModelType, AnalyticsPromptScreenViewModelProtocol { private var actionsSubject: PassthroughSubject = .init() var actions: AnyPublisher { actionsSubject.eraseToAnyPublisher() } /// Initialize a view model with the specified prompt type and app display name. init(termsURL: URL?) { let promptStrings = AnalyticsPromptScreenStrings(termsURL: termsURL) super.init(initialViewState: AnalyticsPromptScreenViewState(strings: promptStrings)) } // MARK: - Public override func process(viewAction: AnalyticsPromptScreenViewAction) { switch viewAction { case .enable: actionsSubject.send(.enable) case .disable: actionsSubject.send(.disable) } } }