Skip to content

Commit 483e115

Browse files
bfoss765claude
andcommitted
fix: remove incorrect [weak self] from SwiftUI View closure
SwiftUI Views are structs (value types), not classes, so they cannot use [weak self] capture lists. Removed the incorrect weak capture from the linkAction closure in DashSpendTermsScreen. This fixes the build error: "'weak' may only be applied to class and class-bound protocol types, not 'DashSpendTermsScreen'" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9761ddb commit 483e115

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendTermsScreen.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ struct DashSpendTermsScreen: View {
5353
title: NSLocalizedString("Accept terms and\nconditions", comment: "DashSpend"),
5454
label: NSLocalizedString("Terms & conditions", comment: "Terms & conditions"),
5555
labelIcon: .custom("external.link"),
56-
linkAction: { [weak self] in
56+
linkAction: {
5757
guard let url = URL(string: provider.termsUrl),
5858
UIApplication.shared.canOpenURL(url) else {
5959
return
6060
}
6161

6262
UIApplication.shared.open(url, options: [:]) { success in
6363
if success {
64-
self?.hasViewedTerms = true
65-
self?.shouldShakeLink = false
64+
hasViewedTerms = true
65+
shouldShakeLink = false
6666
}
6767
}
6868
},

0 commit comments

Comments
 (0)