mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Make sure the Recovery Key option is shown on the IdentityConfirmationScreen when available. (#3699)
There was a race condition where 2 different states could be processed at the same time. * Fix unit test The view model wasn't stored, so relying the current value publisher didn't have time to fire before deinit.
This commit is contained in:
+3
-1
@@ -104,6 +104,8 @@ struct IdentityConfirmationScreen: View {
|
||||
// MARK: - Previews
|
||||
|
||||
struct IdentityConfirmationScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static var viewModel = makeViewModel()
|
||||
|
||||
static var previews: some View {
|
||||
NavigationStack {
|
||||
IdentityConfirmationScreen(context: viewModel.context)
|
||||
@@ -113,7 +115,7 @@ struct IdentityConfirmationScreen_Previews: PreviewProvider, TestablePreview {
|
||||
})
|
||||
}
|
||||
|
||||
private static var viewModel: IdentityConfirmationScreenViewModel {
|
||||
static func makeViewModel() -> IdentityConfirmationScreenViewModel {
|
||||
let clientProxy = ClientProxyMock(.init())
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
userSession.sessionSecurityStatePublisher = CurrentValuePublisher<SessionSecurityState, Never>(.init(verificationState: .unverified, recoveryState: .enabled))
|
||||
|
||||
Reference in New Issue
Block a user