fix welcome shown each time

This commit is contained in:
neon443
2025-11-21 10:58:14 +00:00
parent 60cc167be3
commit 92763fc528
2 changed files with 3 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ class EmojiHoarder: ObservableObject {
@Published var letterStats: [EmojiHoarder.LetterStat] = [] @Published var letterStats: [EmojiHoarder.LetterStat] = []
@Published var letterStatsSorting: EmojiHoarder.LetterStatSorting = .init(by: .letter, ascending: true) @Published var letterStatsSorting: EmojiHoarder.LetterStatSorting = .init(by: .letter, ascending: true)
@Published var showWelcome: Bool = true @Published var showWelcome: Bool = false
init(localOnly: Bool = false, skipIndex: Bool = false) { init(localOnly: Bool = false, skipIndex: Bool = false) {
self.showWelcome = !UserDefaults.standard.bool(forKey: "showWelcome") self.showWelcome = !UserDefaults.standard.bool(forKey: "showWelcome")
@@ -205,7 +205,7 @@ class EmojiHoarder: ObservableObject {
} }
func setShowWelcome(to newValue: Bool) { func setShowWelcome(to newValue: Bool) {
UserDefaults.standard.set(!newValue, forKey: "shownWelcome") UserDefaults.standard.set(!newValue, forKey: "showWelcome")
self.showWelcome = newValue self.showWelcome = newValue
} }

View File

@@ -49,7 +49,7 @@ struct ContentView: View {
} }
} }
.sheet(isPresented: $hoarder.showWelcome) { .sheet(isPresented: $hoarder.showWelcome) {
print("hi") hoarder.setShowWelcome(to: false)
} content: { } content: {
WelcomeView() WelcomeView()
} }