emojipacks should save and load

extracted logic into emojhoarder
This commit is contained in:
neon443 committed 2026-04-10 20:21:06 +01:00
1 parent fc1e812d4f
commit 5ec663af69
4 files changed
+39 -25

No files matched your search

@@ -173,7 +173,7 @@ struct EmojiPackDetailView: View {
}
}
.onDisappear {
hoarder.
hoarder.saveEmojiPacks()
}
}
}
@@ -16,10 +16,7 @@ struct EmojiPackImporterView: View {
EmojiPackDetailView(hoarder: emojiHoarder, pack: $pack)
.overlay(alignment: .bottomLeading) {
Button {
withAnimation {
emojiHoarder.emojiPacks.append(pack)
dismiss()
}
dismiss()
} label: {
Text("Cancel")
.font(.title3)
@@ -31,10 +28,8 @@ struct EmojiPackImporterView: View {
}
.overlay(alignment: .bottomTrailing) {
Button {
withAnimation {
emojiHoarder.emojiPacks.append(pack)
dismiss()
}
emojiHoarder.addEmojiPack(pack)
dismiss()
} label: {
Text("Add")
.font(.title3)
@@ -21,9 +21,7 @@ struct EmojiPackManager: View {
}
.swipeActions(edge: .trailing) {
Button {
withAnimation {
hoarder.emojiPacks.removeAll { $0.id == pack.id }
}
hoarder.removeEmojiPack(pack)
} label: {
Label("Delete", systemImage: "trash")
}
@@ -42,9 +40,7 @@ struct EmojiPackManager: View {
.toolbar {
ToolbarItem {
Button {
withAnimation {
hoarder.emojiPacks.append(.new())
}
hoarder.newEmojiPack()
} label: {
Image(systemName: "plus")
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.