Various fixes

This commit is contained in:
Ilya Laktyushin 2025-05-06 04:14:21 +04:00
parent 7afa30f3d8
commit b7f84a97b5
4 changed files with 16 additions and 15 deletions

View File

@ -1567,6 +1567,9 @@ final class GiftOptionsScreenComponent: Component {
}
}
}
if disallowedGifts.contains(.unique) && gift.availability?.remains == 0 {
return false
}
}
return true
}

View File

@ -184,7 +184,9 @@ public final class PeerInfoGiftsCoverComponent: Component {
}
}
private var scheduledAnimateIn = false
public func willAnimateIn() {
self.scheduledAnimateIn = true
for (_, layer) in self.iconLayers {
layer.opacity = 0.0
}
@ -194,6 +196,7 @@ public final class PeerInfoGiftsCoverComponent: Component {
guard let _ = self.currentSize, let component = self.component else {
return
}
self.scheduledAnimateIn = false
for (_, layer) in self.iconLayers {
layer.opacity = 1.0
@ -319,8 +322,12 @@ public final class PeerInfoGiftsCoverComponent: Component {
self.iconLayers[id] = iconLayer
self.layer.addSublayer(iconLayer)
iconLayer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
iconLayer.animateScale(from: 0.01, to: 1.0, duration: 0.2)
if self.scheduledAnimateIn {
iconLayer.opacity = 0.0
} else {
iconLayer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
iconLayer.animateScale(from: 0.01, to: 1.0, duration: 0.2)
}
iconLayer.startAnimations(index: index)
}
@ -349,7 +356,10 @@ public final class PeerInfoGiftsCoverComponent: Component {
iconTransition.setPosition(layer: iconLayer, position: absolutePosition)
iconLayer.updateRotation(effectiveAngle, transition: iconTransition)
iconTransition.setScale(layer: iconLayer, scale: iconPosition.scale * (1.0 - itemScaleFraction))
iconTransition.setAlpha(layer: iconLayer, alpha: 1.0 - itemScaleFraction)
if !self.scheduledAnimateIn {
iconTransition.setAlpha(layer: iconLayer, alpha: 1.0 - itemScaleFraction)
}
index += 1
}

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "ic_qrcode.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}