Re: [PATCH damus] Add safety reminder for higher balances

1 view
Skip to first unread message

William Casarin

unread,
Apr 24, 2025, 10:09:19 AM4/24/25
to Daniel D’Aquino, pat...@damus.io
On Fri, Apr 18, 2025 at 01:12:02PM -0700, Daniel D’Aquino wrote:
>This commit adds a reminder to users who hold more than 100K sats in
>their NWC wallet, reminding them to learn about self-custody.
>
>Changelog-Added: Added safety reminder to wallets with higher balance
>Closes: https://github.com/damus-io/damus/issues/2984
>Signed-off-by: Daniel D’Aquino <dan...@daquino.me>
>
>Closes: https://github.com/damus-io/damus/pull/2986
>---

Looks good but we'll likely need to update the 100k over time as the
value of bitcoin changes...

Reviewed-by: William Casarin <jb...@jb55.com>

> damus/Views/Wallet/WalletView.swift | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
>diff --git a/damus/Views/Wallet/WalletView.swift b/damus/Views/Wallet/WalletView.swift
>index 6d78e3427..5a565b429 100644
>--- a/damus/Views/Wallet/WalletView.swift
>+++ b/damus/Views/Wallet/WalletView.swift
>@@ -7,6 +7,8 @@
>
> import SwiftUI
>
>+let WALLET_WARNING_THRESHOLD: UInt64 = 100000
>+
> struct WalletView: View {
> let damus_state: DamusState
> @State var show_settings: Bool = false
>@@ -22,6 +24,27 @@ struct WalletView: View {
> func MainWalletView(nwc: WalletConnectURL) -> some View {
> ScrollView {
> VStack(spacing: 35) {
>+ if let balance = model.balance, balance > WALLET_WARNING_THRESHOLD {
>+ VStack(spacing: 10) {
>+ HStack {
>+ Image(systemName: "exclamationmark.circle")
>+ Text("Safety Reminder", comment: "Heading for a safety reminder that appears when the user has too many funds, recommending them to learn about safeguarding their funds.")
>+ .font(.title3)
>+ .bold()
>+ }
>+ .foregroundStyle(.damusWarningTertiary)
>+
>+ Text("If your wallet balance is getting high, it's important to understand how to keep your funds secure. Please consider learning the best practices to ensure your assets remain safe. [Click here](https://damus.io/docs/wallet/high-balance-safety-reminder/) to learn more.", comment: "Text reminding the user has a high balance, recommending them to learn about self-custody")
>+ .foregroundStyle(.damusWarningSecondary)
>+ .opacity(0.8)
>+ }
>+ .padding()
>+ .overlay(
>+ RoundedRectangle(cornerRadius: 20)
>+ .stroke(.damusWarningBorder, lineWidth: 1)
>+ )
>+ }
>+
> VStack(spacing: 5) {
>
> BalanceView(balance: model.balance)
Reply all
Reply to author
Forward
0 new messages