damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 1e44d97a97fbcf50097650527d4d096b2efad7ed
parent 567303e680993fe714419de087ee3c2cc1de7561
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  6 Feb 2023 11:55:20 -0800

refactor: pk_settings_key

will use this in the future I'm sure

Diffstat:
Mdamus/Models/UserSettingsStore.swift | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/damus/Models/UserSettingsStore.swift b/damus/Models/UserSettingsStore.swift @@ -12,9 +12,13 @@ func should_show_wallet_selector(_ pubkey: String) -> Bool { return UserDefaults.standard.object(forKey: "show_wallet_selector") as? Bool ?? true } +func pk_setting_key(_ pubkey: String, key: String) -> String { + return "\(pubkey)_\(key)" +} + let tip_amount_key = "default_tip_amount" func set_default_tip_amount(pubkey: String, amount: Int64) { - let key = "\(pubkey)_\(tip_amount_key)" + let key = pk_setting_key(pubkey, key: tip_amount_key) UserDefaults.standard.setValue(amount, forKey: key) }