ui updates

small fix
This commit is contained in:
neon443
2025-11-22 20:21:30 +00:00
parent b15684d09a
commit e8ff53d87b
2 changed files with 15 additions and 16 deletions

View File

@@ -237,7 +237,6 @@ class EmojiHoarder: ObservableObject {
} }
nonisolated func download(emoji: Emoji, skipStoreIndex: Bool = false) async { nonisolated func download(emoji: Emoji, skipStoreIndex: Bool = false) async {
// Task.detached(priority: .high) {
try? await emoji.downloadImage() try? await emoji.downloadImage()
await MainActor.run { await MainActor.run {
if !skipStoreIndex { if !skipStoreIndex {
@@ -248,7 +247,6 @@ class EmojiHoarder: ObservableObject {
self.trie.dict[emoji.name]?.refresh() self.trie.dict[emoji.name]?.refresh()
if !skipStoreIndex { Haptic.success.trigger() } if !skipStoreIndex { Haptic.success.trigger() }
} }
// }
} }
@MainActor @MainActor

View File

@@ -91,14 +91,16 @@ struct SettingsView: View {
} }
Section("Use with Caution") { Section("Use with Caution") {
Button("download all", role: .destructive) { Button("Download all", systemImage: "square.and.arrow.down.on.square", role: .destructive) {
Task { Task {
await hoarder.downloadAllStickers() await hoarder.downloadAllStickers()
} }
} }
Button("delete all", role: .destructive) { .foregroundStyle(.red)
Button("Delete all", systemImage: "trash.circle", role: .destructive) {
hoarder.deleteAllStickers() hoarder.deleteAllStickers()
} }
.foregroundStyle(.red)
} }
Section("Debug") { Section("Debug") {
@@ -108,12 +110,11 @@ struct SettingsView: View {
Label("Tree", systemImage: "tree") Label("Tree", systemImage: "tree")
} }
Button(role: .destructive) { Button("Reindex", systemImage: "list.bullet.clipboard", role: .destructive) {
hoarder.resetAllIndexes() hoarder.resetAllIndexes()
hoarder.buildTrie() hoarder.buildTrie()
} label: {
Label("Reindex", systemImage: "list.bullet.clipboard.fill")
} }
.foregroundStyle(.red)
} }
// Section(content: <#T##() -> View#>, header: <#T##() -> View#>, footer: <#T##() -> View#>) // Section(content: <#T##() -> View#>, header: <#T##() -> View#>, footer: <#T##() -> View#>)
} }