From 1670677a920735ee57591a99f4c2dc86e7c826a0 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 19 Apr 2026 21:48:47 +0200 Subject: [PATCH] Various fixes --- .../Stickers/ArchivedStickerPacksController.swift | 7 ++++--- .../Stickers/InstalledStickerPacksController.swift | 11 ++++++----- .../Sources/ChatEntityKeyboardInputNode.swift | 2 +- .../Sources/EmojiPagerContentComponent.swift | 1 - 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift b/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift index db9186d25d..91570aadf6 100644 --- a/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift +++ b/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift @@ -257,7 +257,7 @@ public func archivedStickerPacksController(context: AccountContext, mode: Archiv if forceEdit { updateState { - $0.withUpdatedEditing(true) + $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(Set()) } } @@ -428,7 +428,8 @@ public func archivedStickerPacksController(context: AccountContext, mode: Archiv } }, togglePackSelected: { packId in updateState { state in - if var selectedPackIds = state.selectedPackIds { + if state.editing { + var selectedPackIds = state.selectedPackIds ?? Set() if selectedPackIds.contains(packId) { selectedPackIds.remove(packId) } else { @@ -554,7 +555,7 @@ public func archivedStickerPacksController(context: AccountContext, mode: Archiv presentControllerImpl?(actionSheet, nil) }), .init(title: presentationData.strings.StickerPacks_ActionShare, isEnabled: selectedCount > 0, action: { updateState { - $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(nil) + $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(Set()) } var packNames: [String] = [] diff --git a/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift b/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift index b017259335..2b530933f6 100644 --- a/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift +++ b/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift @@ -657,7 +657,7 @@ public func installedStickerPacksController(context: AccountContext, mode: Insta if focusOnItemTag == InstalledStickerPacksEntryTag.edit { updateState { - $0.withUpdatedEditing(true) + $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(Set()) } } @@ -836,7 +836,8 @@ public func installedStickerPacksController(context: AccountContext, mode: Insta }).start() }, togglePackSelected: { packId in updateState { state in - if var selectedPackIds = state.selectedPackIds { + if state.editing { + var selectedPackIds = state.selectedPackIds ?? Set() if selectedPackIds.contains(packId) { selectedPackIds.remove(packId) } else { @@ -989,7 +990,7 @@ public func installedStickerPacksController(context: AccountContext, mode: Insta if case .modal = mode { updateState { - $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(nil) + $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(Set()) } } else { updateState { @@ -1020,7 +1021,7 @@ public func installedStickerPacksController(context: AccountContext, mode: Insta if case .modal = mode { updateState { - $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(nil) + $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(Set()) } } else { updateState { @@ -1046,7 +1047,7 @@ public func installedStickerPacksController(context: AccountContext, mode: Insta }), .init(title: presentationData.strings.StickerPacks_ActionShare, isEnabled: selectedCount > 0, action: { if case .modal = mode { updateState { - $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(nil) + $0.withUpdatedEditing(true).withUpdatedSelectedPackIds(Set()) } } else { updateState { diff --git a/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift b/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift index 2a008e3252..8dc981dd44 100644 --- a/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift +++ b/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift @@ -1131,7 +1131,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode { var version = 0 self.emojiSearchStateValue.isSearching = true self.emojiSearchDisposable.set((resultSignal - |> delay(0.15, queue: .mainQueue()) + |> delay(0.25, queue: .mainQueue()) |> deliverOnMainQueue).start(next: { [weak self] result in guard let self else { return diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift index ac6e493ce7..0c80094a14 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift @@ -4926,7 +4926,6 @@ public final class EmojiPagerContentComponent: Component { } self.updateVisibleItems(transition: itemTransition, attemptSynchronousLoads: attemptSynchronousLoads, previousItemPositions: previousItemPositions, previousAbsoluteItemPositions: previousAbsoluteItemPositions, updatedItemPositions: updatedItemPositions, hintDisappearingGroupFrame: hintDisappearingGroupFrame) - self.maybeLoadMore() if animateContentCrossfade { for (_, itemLayer) in self.visibleItemLayers {