mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-03-11 13:26:17 +00:00
fix welcome shown each time
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user