Skip to content

Commit 3c077c2

Browse files
author
Isaac
committed
Fix API usage
1 parent 15b20e5 commit 3c077c2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

submodules/TelegramCore/Sources/TelegramEngine/Payments/GiftCodes.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ public final class CachedPremiumGiftCodeOptions: Codable {
169169
}
170170

171171
func _internal_premiumGiftCodeOptions(account: Account, peerId: EnginePeer.Id?, onlyCached: Bool = false) -> Signal<[PremiumGiftCodeOption], NoError> {
172+
if let peerId {
173+
if peerId.namespace == Namespaces.Peer.SecretChat {
174+
return .single([])
175+
}
176+
}
177+
172178
let cached = account.postbox.transaction { transaction -> Signal<[PremiumGiftCodeOption], NoError> in
173179
if let entry = transaction.retrieveItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedPremiumGiftCodeOptions, key: ValueBoxKey(length: 0)))?.get(CachedPremiumGiftCodeOptions.self) {
174180
return .single(entry.options)
@@ -222,6 +228,12 @@ func _internal_premiumGiftCodeOptions(account: Account, peerId: EnginePeer.Id?,
222228

223229

224230
func _internal_premiumGiftCodeOptions(account: Account, peerId: EnginePeer.Id?) -> Signal<[PremiumGiftCodeOption], NoError> {
231+
if let peerId {
232+
if peerId.namespace == Namespaces.Peer.SecretChat {
233+
return .single([])
234+
}
235+
}
236+
225237
var flags: Int32 = 0
226238
if let _ = peerId {
227239
flags |= 1 << 0

0 commit comments

Comments
 (0)