Skip to content

Commit

Permalink
feat: disable dd keys saving and bump to 6.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
krodak committed Feb 1, 2024
1 parent 267f918 commit 8ba6f6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 45 deletions.
6 changes: 3 additions & 3 deletions ios/PolkadotVault.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@
"$(inherited)",
"$(PROJECT_DIR)/PolkadotVault",
);
MARKETING_VERSION = 6.3.1;
MARKETING_VERSION = 6.3.2;
PRODUCT_BUNDLE_IDENTIFIER = io.parity.NativeSigner;
PRODUCT_MODULE_NAME = PolkadotVault;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3063,7 +3063,7 @@
"$(inherited)",
"$(PROJECT_DIR)/PolkadotVault",
);
MARKETING_VERSION = 6.3.1;
MARKETING_VERSION = 6.3.2;
PRODUCT_BUNDLE_IDENTIFIER = io.parity.NativeSigner;
PRODUCT_MODULE_NAME = PolkadotVault;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3205,7 +3205,7 @@
"$(inherited)",
"$(PROJECT_DIR)/PolkadotVault",
);
MARKETING_VERSION = 6.3.1;
MARKETING_VERSION = 6.3.2;
PRODUCT_BUNDLE_IDENTIFIER = io.parity.NativeSigner;
PRODUCT_MODULE_NAME = PolkadotVault;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ struct AddDerivedKeysView: View {
)
.clearModalBackground()
}
.fullScreenModal(
isPresented: $viewModel.isPresentingAddKeysCancelation
) {
HorizontalActionsBottomModal(
viewModel: .cancelAddingDerivedKeys,
mainAction: viewModel.onAddCancelationTap(),
isShowingBottomAlert: $viewModel.isPresentingAddKeysCancelation
)
.clearModalBackground()
}
}

@ViewBuilder
Expand Down Expand Up @@ -211,49 +201,36 @@ extension AddDerivedKeysView {
final class ViewModel: ObservableObject {
private let onCompletion: (OnCompletionAction) -> Void
let dynamicDerivationsPreview: DdPreview
private let derivedKeysService: CreateDerivedKeyService
private let seedsMediator: SeedsMediating
let dataModel: AddDerivedKeysData
@Binding var isPresented: Bool
@Published var isPresentingAddKeysCancelation: Bool = false
@Published var isPresentingDerivationPath: Bool = false
@Published var isPresentingError: Bool = false
@Published var presentableError: ErrorBottomModalViewModel = .importDynamicDerivedKeys(content: "")

init(
dataModel: AddDerivedKeysData,
dynamicDerivationsPreview: DdPreview,
derivedKeysService: CreateDerivedKeyService = CreateDerivedKeyService(),
seedsMediator: SeedsMediating = ServiceLocator.seedsMediator,
isPresented: Binding<Bool>,
onCompletion: @escaping (OnCompletionAction) -> Void
) {
self.dataModel = dataModel
self.dynamicDerivationsPreview = dynamicDerivationsPreview
self.derivedKeysService = derivedKeysService
self.seedsMediator = seedsMediator
_isPresented = isPresented
self.onCompletion = onCompletion
}

func onMainActionTap() {
if dynamicDerivationsPreview.keySet.derivations.isEmpty {
onSuccess()
} else {
continueCreation()
}
onSuccess()
}

func onAddCancelationTap() {
onCancel()
}

func onBackTap() {
if dynamicDerivationsPreview.keySet.derivations.isEmpty {
onCancel()
} else {
isPresentingAddKeysCancelation = true
}
onCancel()
}

private func onSuccess() {
Expand All @@ -265,22 +242,6 @@ extension AddDerivedKeysView {
isPresented = false
onCompletion(.onCancel)
}

private func continueCreation() {
derivedKeysService.createDerivedKeys(
dynamicDerivationsPreview.keySet.seedName,
seedsMediator.getSeed(seedName: dynamicDerivationsPreview.keySet.seedName),
keysToImport: dynamicDerivationsPreview.keySet.derivations
) { [weak self] result in
switch result {
case .success:
self?.onSuccess()
case let .failure(error):
self?.presentableError = .importDynamicDerivedKeys(content: error.localizedDescription)
self?.isPresentingError = true
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class RecoverKeySetNameViewModelTests: XCTestCase {
private var onCompletionExecuted: Bool = false

override func setUp() {
super.setUp()
super.setUp()
seedsMediatorMock = SeedsMediatingMock()
isPresented = false
onCompletionExecuted = false
Expand Down

0 comments on commit 8ba6f6b

Please sign in to comment.