From 042263fd9d48263e6ba4e0b1d375d594a2f3d7f9 Mon Sep 17 00:00:00 2001 From: Nihaal Sharma <69979447+neon443@users.noreply.github.com> Date: Mon, 6 Jul 2026 14:11:00 +0100 Subject: [PATCH] fixed multidelete --- .../UIKit/EmojiPacks/EmojiPackListView.swift | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift b/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift index e6d6415..285c284 100644 --- a/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift +++ b/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift @@ -158,10 +158,19 @@ class EmojiPackListView: UITableViewController { @objc func multiDelete() { guard let selectedRows = self.tableView.indexPathsForSelectedRows else { return } + + var packs: [EmojiPack] = [] for indexPath in selectedRows { - guard let pack = packFor(indexPath: indexPath) else { continue } - delete(indexPath) + guard let pack = packFor(indexPath: indexPath) else { return } + packs.append(pack) } + guard !packs.isEmpty else { return } + + for pack in packs { + self.emojiHoarder.removeEmojiPack(pack) + } + self.tableView.deleteRows(at: selectedRows, with: .automatic) + setEditing(false, animated: true) } func dup(_ indexPath: IndexPath) {