Skip to content

Commit

Permalink
Merge branch 'develop' into fix/onboarding-tx-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
pankcuf authored Jul 10, 2024
2 parents 8e21ec1 + 929122c commit 10d57d8
Show file tree
Hide file tree
Showing 24 changed files with 572 additions and 602 deletions.
14 changes: 6 additions & 8 deletions DashWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
2A2CD71322F97B65008C7BC9 /* CALayer+DWShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A2CD71222F97B65008C7BC9 /* CALayer+DWShadow.m */; };
2A2CD71822F99CAE008C7BC9 /* ShortcutsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2A2CD71722F99CAE008C7BC9 /* ShortcutsView.xib */; };
2A2CD72222F9B571008C7BC9 /* DWIntrinsicCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A2CD72122F9B571008C7BC9 /* DWIntrinsicCollectionView.m */; };
2A36A88B2350A05B0014DC60 /* DWBackupSeedPhraseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A36A88A2350A05B0014DC60 /* DWBackupSeedPhraseViewController.m */; };
2A392568234CFE9D00316EA6 /* NSAttributedString+DWHighlightText.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A392567234CFE9D00316EA6 /* NSAttributedString+DWHighlightText.m */; };
2A3DC86E239717C2004B3DBA /* DWRecoverWalletCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A3DC86D239717C2004B3DBA /* DWRecoverWalletCommand.m */; };
2A4430E722CBB6EC009BAF7F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A4430E622CBB6EC009BAF7F /* AppDelegate.m */; };
Expand Down Expand Up @@ -562,6 +561,8 @@
755A22BD2B1385FD001F170D /* IconAttributedText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755A22BC2B1385FD001F170D /* IconAttributedText.swift */; };
755B4B222B0C903500B844F0 /* DWDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755B4B212B0C903500B844F0 /* DWDateFormatter.swift */; };
755B4B232B0C903500B844F0 /* DWDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755B4B212B0C903500B844F0 /* DWDateFormatter.swift */; };
755C32382C358FC0007DA721 /* BackupSeedPhraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755C32372C358FBD007DA721 /* BackupSeedPhraseViewController.swift */; };
755C32392C358FC0007DA721 /* BackupSeedPhraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755C32372C358FBD007DA721 /* BackupSeedPhraseViewController.swift */; };
755E6DFE2A99E7A000A42870 /* DWInvitationSetupState.m in Sources */ = {isa = PBXBuildFile; fileRef = 755E6DFC2A99E7A000A42870 /* DWInvitationSetupState.m */; };
756188212B1EE78A00B778E3 /* DPVotingResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 756188202B1EE78A00B778E3 /* DPVotingResultView.swift */; };
7565D5952B08B35F0092C9BA /* RequestUsernameViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7565D5942B08B35F0092C9BA /* RequestUsernameViewModel.swift */; };
Expand Down Expand Up @@ -1168,7 +1169,6 @@
C9D2C7B22A320AA000D15901 /* (null) in Sources */ = {isa = PBXBuildFile; };
C9D2C7B32A320AA000D15901 /* SpecifyAmountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47AC8412297822E000BD1B49 /* SpecifyAmountViewController.swift */; };
C9D2C7B42A320AA000D15901 /* DWUpholdTransactionObject+DWView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCB9C323BE76EC00FF59A6 /* DWUpholdTransactionObject+DWView.m */; };
C9D2C7B52A320AA000D15901 /* DWBackupSeedPhraseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A36A88A2350A05B0014DC60 /* DWBackupSeedPhraseViewController.m */; };
C9D2C7B62A320AA000D15901 /* CrowdNodeDepositTx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 114CFECF296469D9005F421B /* CrowdNodeDepositTx.swift */; };
C9D2C7B92A320AA000D15901 /* DWIntrinsicTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A9FFF072233E56E00956D5F /* DWIntrinsicTableView.m */; };
C9D2C7BA2A320AA000D15901 /* DWURLActions.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A913E6523A11DFE006A2A59 /* DWURLActions.m */; };
Expand Down Expand Up @@ -1788,8 +1788,6 @@
2A2CD72022F9B571008C7BC9 /* DWIntrinsicCollectionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWIntrinsicCollectionView.h; sourceTree = "<group>"; };
2A2CD72122F9B571008C7BC9 /* DWIntrinsicCollectionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DWIntrinsicCollectionView.m; sourceTree = "<group>"; };
2A36A887234F3F400014DC60 /* DWSelectorFormItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWSelectorFormItem.h; sourceTree = "<group>"; };
2A36A8892350A05B0014DC60 /* DWBackupSeedPhraseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWBackupSeedPhraseViewController.h; sourceTree = "<group>"; };
2A36A88A2350A05B0014DC60 /* DWBackupSeedPhraseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DWBackupSeedPhraseViewController.m; sourceTree = "<group>"; };
2A36A88C2350A18A0014DC60 /* DWPreviewSeedPhraseViewController+DWProtected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DWPreviewSeedPhraseViewController+DWProtected.h"; sourceTree = "<group>"; };
2A392566234CFE9D00316EA6 /* NSAttributedString+DWHighlightText.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSAttributedString+DWHighlightText.h"; sourceTree = "<group>"; };
2A392567234CFE9D00316EA6 /* NSAttributedString+DWHighlightText.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSAttributedString+DWHighlightText.m"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2433,6 +2431,7 @@
754BEA112C0B6BD700E8C93C /* HomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewModel.swift; sourceTree = "<group>"; };
755A22BC2B1385FD001F170D /* IconAttributedText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconAttributedText.swift; sourceTree = "<group>"; };
755B4B212B0C903500B844F0 /* DWDateFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DWDateFormatter.swift; sourceTree = "<group>"; };
755C32372C358FBD007DA721 /* BackupSeedPhraseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackupSeedPhraseViewController.swift; sourceTree = "<group>"; };
755E6DFC2A99E7A000A42870 /* DWInvitationSetupState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWInvitationSetupState.m; sourceTree = "<group>"; };
755E6DFD2A99E7A000A42870 /* DWInvitationSetupState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWInvitationSetupState.h; sourceTree = "<group>"; };
756188202B1EE78A00B778E3 /* DPVotingResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DPVotingResultView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3994,8 +3993,7 @@
2A4431D922D675CD009BAF7F /* DWPreviewSeedPhraseViewController.h */,
2A4431DA22D675CD009BAF7F /* DWPreviewSeedPhraseViewController.m */,
2A36A88C2350A18A0014DC60 /* DWPreviewSeedPhraseViewController+DWProtected.h */,
2A36A8892350A05B0014DC60 /* DWBackupSeedPhraseViewController.h */,
2A36A88A2350A05B0014DC60 /* DWBackupSeedPhraseViewController.m */,
755C32372C358FBD007DA721 /* BackupSeedPhraseViewController.swift */,
);
path = Seed;
sourceTree = "<group>";
Expand Down Expand Up @@ -8587,6 +8585,7 @@
C9FAABB72AB799AE00878224 /* UpholdPortalModel.swift in Sources */,
C3DAD268246AA6F10001624F /* DWScreenshotWarningViewController.m in Sources */,
4751CACD297021EE00F63AC4 /* ConvertCryptoOrderPreviewController.swift in Sources */,
755C32382C358FC0007DA721 /* BackupSeedPhraseViewController.swift in Sources */,
4708119F2990F56F003FCA3D /* TransactionDataItem.swift in Sources */,
2A44314322CF80D9009BAF7F /* DWSetPinModel.m in Sources */,
2AD1CE8D22DCB3B600C99324 /* DWVerifySeedPhraseModel.m in Sources */,
Expand Down Expand Up @@ -8639,7 +8638,6 @@
47AC8413297822E000BD1B49 /* SpecifyAmountViewController.swift in Sources */,
2AFCB9C423BE76EC00FF59A6 /* DWUpholdTransactionObject+DWView.m in Sources */,
75CDD7862C08D61300F433D2 /* DashAmount.swift in Sources */,
2A36A88B2350A05B0014DC60 /* DWBackupSeedPhraseViewController.m in Sources */,
114CFED0296469D9005F421B /* CrowdNodeDepositTx.swift in Sources */,
2A9FFF192233E56E00956D5F /* DWIntrinsicTableView.m in Sources */,
2A913E6623A11DFE006A2A59 /* DWURLActions.m in Sources */,
Expand Down Expand Up @@ -9369,7 +9367,6 @@
C943B5922A40ED7B00AF23C5 /* DWTextField.m in Sources */,
75EBAA0D2BB9792F004488E3 /* FeatureTopText.swift in Sources */,
C9D2C7B42A320AA000D15901 /* DWUpholdTransactionObject+DWView.m in Sources */,
C9D2C7B52A320AA000D15901 /* DWBackupSeedPhraseViewController.m in Sources */,
C943B54A2A40B52F00AF23C5 /* NSLayoutConstraint+DWAutolayout.m in Sources */,
C943B5892A40ED5A00AF23C5 /* DWDashPaySetupFlowController.m in Sources */,
C9D2C7B62A320AA000D15901 /* CrowdNodeDepositTx.swift in Sources */,
Expand Down Expand Up @@ -9581,6 +9578,7 @@
C9D2C85D2A320AA000D15901 /* DWLockPinInputView.m in Sources */,
C9D2C85E2A320AA000D15901 /* UIView+DWHUD.m in Sources */,
C9D2C85F2A320AA000D15901 /* DWPayOptionModel.m in Sources */,
755C32392C358FC0007DA721 /* BackupSeedPhraseViewController.swift in Sources */,
C9D2C8612A320AA000D15901 /* CoinbaseTokenResponse.swift in Sources */,
C9D2C8622A320AA000D15901 /* BackupInfoViewController.swift in Sources */,
C9D2C8642A320AA000D15901 /* AppliedFiltersView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,29 @@ final class BackupInfoViewController: BaseViewController {

@IBAction
func backupButtonAction() {
if type == .setup {
let authManager = DSAuthenticationManager.sharedInstance()

if type == .setup && authManager.didAuthenticate {
showSeedPhraseViewController()
} else {
DSAuthenticationManager.sharedInstance()
.authenticate(withPrompt: nil,
usingBiometricAuthentication: false,
alertIfLockout: true) { [weak self] authenticated, _, _ in
guard authenticated else {
return
}

guard let self else {
return
}
authManager.authenticate(withPrompt: nil,
usingBiometricAuthentication: false,
alertIfLockout: true) { [weak self] authenticated, _, _ in
guard authenticated else {
return
}

guard let self else {
return
}

if type != .setup {
self.seedPhraseModel = DWPreviewSeedPhraseModel()
self.seedPhraseModel.getOrCreateNewWallet()
self.showSeedPhraseViewController()
}

self.showSeedPhraseViewController()
}
}
}

Expand Down Expand Up @@ -194,7 +198,7 @@ extension BackupInfoViewController {
}

private func showSeedPhraseViewController() {
let controller = DWBackupSeedPhraseViewController(model: seedPhraseModel)
let controller = BackupSeedPhraseViewController(model: seedPhraseModel)
controller.shouldCreateNewWalletOnScreenshot = shouldCreateNewWalletOnScreenshot
controller.delegate = delegate
navigationController?.pushViewController(controller, animated: true)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// Created by Andrew Podkovyrin
// Copyright © 2019 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation

import UIKit

class BackupSeedPhraseViewController: DWPreviewSeedPhraseViewController {

var shouldCreateNewWalletOnScreenshot: Bool = false

override func viewDidLoad() {
super.viewDidLoad()

self.title = NSLocalizedString("Backup Wallet", comment: "A noun. Used as a title.")
self.actionButton?.isEnabled = false

self.contentView.displayType = DWSeedPhraseDisplayType.backup

#if SNAPSHOT
self.actionButton.accessibilityIdentifier = "seedphrase_continue_button"
#endif
}

var actionButtonTitle: String {
return NSLocalizedString("Continue", comment: "")
}

@objc override func actionButtonAction(_ sender: Any) {
let seedPhrase = self.contentView.model

let controller = DWVerifySeedPhraseViewController(seedPhrase: seedPhrase!)
controller.delegate = self.delegate
self.navigationController?.pushViewController(controller, animated: true)
}

override func screenshotAlertOKAction() {
if !self.shouldCreateNewWalletOnScreenshot {
return
}

self.model.clearAllWallets()

self.feedbackGenerator.notificationOccurred(.error)

let seedPhrase = self.model.getOrCreateNewWallet()
self.contentView.updateSeedPhraseModelAnimated(seedPhrase)
self.contentView.showScreenshotDetectedErrorMessage()

self.actionButton?.isEnabled = false
}
}

This file was deleted.

This file was deleted.

5 changes: 4 additions & 1 deletion DashWallet/dashwallet-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ static const bool _SNAPSHOT = 0;
#import "DWCenteredTableView.h"

//MARK: Backup Wallet
#import "DWBackupSeedPhraseViewController.h"
#import "DWPreviewSeedPhraseViewController.h"
#import "DWSecureWalletDelegate.h"
#import "DWPreviewSeedPhraseContentView.h"
#import "DWPreviewSeedPhraseViewController+DWProtected.h"
#import "DWVerifySeedPhraseViewController.h"

//MARK: Payment flow
#import "DWQRScanModel.h"
Expand Down
Loading

0 comments on commit 10d57d8

Please sign in to comment.