commit a6cbf50def9ad316aae058bfb4b300306d3cb447
parent 94bd1942874838528207b686ff071b805ca2926b
Author: William Casarin <jb55@jb55.com>
Date: Mon, 3 Jul 2023 16:06:27 -0700
settings: record bool option keys
so that NostrScripts know which bool settings can be set
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/damus/Models/UserSettingsStore.swift b/damus/Models/UserSettingsStore.swift
@@ -15,6 +15,9 @@ let fallback_zap_amount = 1000
private var value: T
init(key: String, default_value: T) {
+ if T is bool {
+ UserSettingsStore.bool_options.insert(key)
+ }
self.key = pk_setting_key(UserSettingsStore.pubkey ?? "", key: key)
if let loaded = UserDefaults.standard.object(forKey: self.key) as? T {
self.value = loaded
@@ -77,6 +80,7 @@ let fallback_zap_amount = 1000
class UserSettingsStore: ObservableObject {
static var pubkey: String? = nil
static var shared: UserSettingsStore? = nil
+ static var bool_options = Set<String>()
@StringSetting(key: "default_wallet", default_value: .system_default_wallet)
var default_wallet: Wallet