Skip to content

Commit

Permalink
Manually cancel the identity reset handle when dismissing the Encrypt…
Browse files Browse the repository at this point in the history
…ionReset screen.
  • Loading branch information
stefanceriu committed Aug 9, 2024
1 parent 4617d0c commit 13d2fa7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ final class EncryptionResetScreenCoordinator: CoordinatorProtocol {
}
.store(in: &cancellables)
}

func stop() {
viewModel.stop()
}

func toPresentable() -> AnyView {
AnyView(EncryptionResetScreen(context: viewModel.context))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ class EncryptionResetScreenViewModel: EncryptionResetScreenViewModelType, Encryp
}
}

func stop() {
Task {
await identityResetHandle?.cancel()
}
}

// MARK: - Private

private func startResetFlow() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ protocol EncryptionResetScreenViewModelProtocol {
var context: EncryptionResetScreenViewModelType.Context { get }

func continueResetFlowWith(password: String)
func stop()
}

0 comments on commit 13d2fa7

Please sign in to comment.