Fix filtered gifts pinning

This commit is contained in:
Ilya Laktyushin 2025-03-07 23:18:38 +04:00
parent 1483207919
commit c39ba69250

View File

@ -1210,6 +1210,10 @@ private final class ProfileGiftsContextImpl {
if let reference = gift.reference, existingGifts.contains(reference) {
continue
}
var gift = gift
if gift.reference == reference {
gift = gift.withPinnedToTop(pinnedToTop)
}
updatedGifts.append(gift)
}
updatedGifts.sort { lhs, rhs in
@ -1238,6 +1242,10 @@ private final class ProfileGiftsContextImpl {
if let reference = gift.reference, existingFilteredGifts.contains(reference) {
continue
}
var gift = gift
if gift.reference == reference {
gift = gift.withPinnedToTop(pinnedToTop)
}
updatedFilteredGifts.append(gift)
}
updatedFilteredGifts.sort { lhs, rhs in