ios/BitwardenWatchApp/ViewModels/BWStateViewModel.swift
2024-01-16 06:46:13 -07:00

29 lines
990 B
Swift

import Foundation
class BWStateViewModel: ObservableObject {
@Published var text: String
@Published var isLoading: Bool = false
init(_ state: BWState, _ defaultText: String?) {
switch state {
case .needLogin:
text = "LogInToBitwardenOnYourIPhoneToViewVerificationCodes"
// case .needUnlock:
// text = "UnlockBitwardenOnYourIPhoneToViewVerificationCodes"
case .needPremium:
text = "ToViewVerificationCodesUpgradeToPremium"
case .needSetup:
text = "SetUpBitwardenToViewItemsContainingVerificationCodes"
case .syncing:
text = "SyncingItemsContainingVerificationCodes"
isLoading = true
case .need2FAItem:
text = "Add2FactorAutenticationToAnItemToViewVerificationCodes"
case .needDeviceOwnerAuth:
text = "SetUpAppleWatchPasscodeInOrderToUseBitwarden"
default:
text = defaultText ?? ""
}
}
}