mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-08-27 16:22:42 +02:00
Update Ghostgram features
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
+3
-3
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user