Update Ghostgram features

This commit is contained in:
ichmagmaus 812
2026-03-07 18:19:16 +01:00
parent 32b0dddcd9
commit 13a43b9068
902 changed files with 148295 additions and 62348 deletions
@@ -50,7 +50,7 @@ private func actionForAttribute(attribute: StarGift.UniqueGift.Attribute, presen
let searchComponents = searchQuery.lowercased().components(separatedBy: .whitespaces).filter { !$0.isEmpty }
switch attribute {
case let .model(name, file, _), let .pattern(name, file, _):
case let .model(name, file, _, _), let .pattern(name, file, _):
let attributeId: ResaleGiftsContext.Attribute
if case .model = attribute {
attributeId = .model(file.fileId.id)
@@ -320,7 +320,7 @@ private final class GiftAttributeListContextItemNode: ASDisplayNode, ContextMenu
private func getAttributeId(from attribute: StarGift.UniqueGift.Attribute) -> AnyHashable {
switch attribute {
case let .model(_, file, _):
case let .model(_, file, _, _):
return AnyHashable("model_\(file.fileId.id)")
case let .pattern(_, file, _):
return AnyHashable("pattern_\(file.fileId.id)")
@@ -582,7 +582,7 @@ private func filteredAttributes(attributes: [StarGift.UniqueGift.Attribute], que
for attribute in attributes {
let string: String
switch attribute {
case let .model(name, _, _):
case let .model(name, _, _, _):
string = name
case let .pattern(name, _, _):
string = name
@@ -537,8 +537,8 @@ final class GiftStoreScreenComponent: Component {
} else {
return false
}
}.sorted(by: { lhs, rhs in
if case let .model(_, lhsFile, _) = lhs, case let .model(_, rhsFile, _) = rhs, let lhsCount = self.state?.starGiftsState?.attributeCount[.model(lhsFile.fileId.id)], let rhsCount = self.state?.starGiftsState?.attributeCount[.model(rhsFile.fileId.id)] {
}.sorted(by: { (lhs: StarGift.UniqueGift.Attribute, rhs: StarGift.UniqueGift.Attribute) in
if case let .model(_, lhsFile, _, _) = lhs, case let .model(_, rhsFile, _, _) = rhs, let lhsCount = self.state?.starGiftsState?.attributeCount[.model(lhsFile.fileId.id)], let rhsCount = self.state?.starGiftsState?.attributeCount[.model(rhsFile.fileId.id)] {
return lhsCount > rhsCount
} else {
return false
@@ -1231,7 +1231,7 @@ final class GiftStoreScreenComponent: Component {
self.context = context
self.peerId = peerId
self.gift = gift
self.starGiftsContext = ResaleGiftsContext(account: context.account, giftId: gift.id)
self.starGiftsContext = ResaleGiftsContext(account: context.account, giftId: gift.id, forCrafting: false)
super.init()