Various fixes

This commit is contained in:
Ilya Laktyushin 2026-04-19 21:48:47 +02:00
parent b138b9f549
commit 1670677a92
4 changed files with 11 additions and 10 deletions

View file

@ -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] = []

View file

@ -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 {

View file

@ -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

View file

@ -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 {