Skip to content

Commit 11299c6

Browse files
authored
Merge pull request #702 from Syn-McJ/fix/quick-scan
fix: deeplink from camera & balance auth
2 parents 101045a + d7236bd commit 11299c6

4 files changed

Lines changed: 22 additions & 9 deletions

File tree

DashWallet/Sources/UI/Payment Controller/Enter Amount/ProvideAmountViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ struct ProvideAmountIntro<Content: View>: View {
193193
destination: destination,
194194
dashBalance: CoinJoinService.shared.mixingState.isInProgress ? model.coinJoinBalance : model.walletBalance,
195195
balanceLabel: balanceLabel + ":",
196+
authCallback: model.auth,
196197
avatarView: avatarView
197198
)
198199
}

DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ - (void)processPaymentInput:(DWPaymentInput *)paymentInput {
159159
self.paymentInput = paymentInput;
160160

161161
if (paymentInput.request) {
162-
if (paymentInput.source == DWPaymentInputSource_ScanQR && paymentInput.request.isValidAsNonDashpayPaymentRequest) {
162+
if ((paymentInput.source == DWPaymentInputSource_ScanQR || paymentInput.source == DWPaymentInputSource_URL) && paymentInput.request.isValidAsNonDashpayPaymentRequest) {
163163
DSPaymentProtocolRequest *protocolRequest = [self protocolRequestFromPaymentRequest:self.paymentInput.request];
164164
[self txManagerRequestingAdditionalInfo:DSRequestingAdditionalInfo_Amount
165165
protocolRequest:protocolRequest];

DashWallet/Sources/UI/SwiftUI Components/SendIntro.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct SendIntro<Content: View>: View {
2424
var destination: String? = nil
2525
var dashBalance: UInt64? = nil
2626
var balanceLabel: String? = nil
27+
var authCallback: ((@escaping (Bool) -> Void) -> Void)? = nil
2728
@ViewBuilder var avatarView: () -> Content
2829

2930
var body: some View {
@@ -63,7 +64,7 @@ struct SendIntro<Content: View>: View {
6364
}
6465

6566
Button(action: {
66-
balanceHidden.toggle()
67+
toggleBalanceVisibility()
6768
}) {
6869
Image(systemName: balanceHidden ? "eye.slash.fill" : "eye.fill")
6970
.resizable()
@@ -82,6 +83,18 @@ struct SendIntro<Content: View>: View {
8283
}.frame(maxWidth: .infinity, alignment: .leading)
8384
}
8485

86+
private func toggleBalanceVisibility() {
87+
if let authCallback = authCallback, balanceHidden {
88+
authCallback { [self] isAuthenticated in
89+
if isAuthenticated {
90+
balanceHidden.toggle()
91+
}
92+
}
93+
} else {
94+
balanceHidden.toggle()
95+
}
96+
}
97+
8598
@ViewBuilder
8699
private func FormattedFiatText(from dashAmount: UInt64) -> some View {
87100
let text = (try? CurrencyExchanger.shared.convertDash(amount: dashAmount.dashAmount, to: App.fiatCurrency).formattedFiatAmount) ?? NSLocalizedString("Not available", comment: "")

Podfile.lock

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,11 @@ PODS:
591591
- "!ProtoCompiler-gRPCPlugin (~> 1.0)"
592592
- DAPI-GRPC/Messages
593593
- gRPC-ProtoRPC
594-
- DashSharedCore (0.5.0)
594+
- DashSharedCore (0.5.1)
595595
- DashSync (0.1.0):
596596
- CocoaLumberjack (= 3.7.2)
597597
- DAPI-GRPC (= 0.22.0-dev.8)
598+
- DashSharedCore (= 0.5.1)
598599
- DSDynamicOptions (= 0.1.2)
599600
- DWAlertController (= 0.2.1)
600601
- TinyCborObjc (= 0.4.6)
@@ -736,7 +737,6 @@ PODS:
736737
DEPENDENCIES:
737738
- CloudInAppMessaging (= 0.1.0)
738739
- CocoaImageHashing (from `https://github.com/ameingast/cocoaimagehashing.git`, commit `ad01eee`)
739-
- DashSharedCore (from `../dash-shared-core/`)
740740
- DashSync (from `../DashSync/`)
741741
- DSDynamicOptions (= 0.1.2)
742742
- Firebase/DynamicLinks
@@ -766,6 +766,7 @@ SPEC REPOS:
766766
- CloudInAppMessaging
767767
- CocoaLumberjack
768768
- DAPI-GRPC
769+
- DashSharedCore
769770
- DSDynamicOptions
770771
- DWAlertController
771772
- Firebase
@@ -803,8 +804,6 @@ EXTERNAL SOURCES:
803804
CocoaImageHashing:
804805
:commit: ad01eee
805806
:git: https://github.com/ameingast/cocoaimagehashing.git
806-
DashSharedCore:
807-
:path: "../dash-shared-core/"
808807
DashSync:
809808
:path: "../DashSync/"
810809
MMSegmentSlider:
@@ -832,8 +831,8 @@ SPEC CHECKSUMS:
832831
CocoaImageHashing: 8656031d0899abe6c1c415827de43e9798189c53
833832
CocoaLumberjack: b7e05132ff94f6ae4dfa9d5bce9141893a21d9da
834833
DAPI-GRPC: 138d62523bbfe7e88a39896f1053c0bc12390d9f
835-
DashSharedCore: 18baa0f6c2bc2b4fc4628651d293f4fd6645025f
836-
DashSync: 2438dbf626f13a8633ccc19c718c1c223c8ee831
834+
DashSharedCore: b8481feb5f08acf162b548edbfc7a9b1ce491141
835+
DashSync: 1f5741aad267dcc0cfc04b6903490d304232ddf2
837836
DSDynamicOptions: 347cc5d2c4e080eb3de6a86719ad3d861b82adfc
838837
DWAlertController: 5f4cd8adf90336331c054857f709f5f8d4b16a5b
839838
Firebase: 5f8193dff4b5b7c5d5ef72ae54bb76c08e2b841d
@@ -868,6 +867,6 @@ SPEC CHECKSUMS:
868867
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
869868
UIViewController-KeyboardAdditions: a691dc7e63a49854d341455a778ee8497dfc4662
870869

871-
PODFILE CHECKSUM: 1ec71e13430fe0345b364b97448746daa931e0b4
870+
PODFILE CHECKSUM: a5ef71862394897c78a0cc247502754372e88c07
872871

873872
COCOAPODS: 1.15.2

0 commit comments

Comments
 (0)