Various fixes

This commit is contained in:
Ilya Laktyushin
2024-07-15 16:40:29 +04:00
parent 1466cd82fe
commit 3b5fc9afb3
5 changed files with 26 additions and 8 deletions

View File

@@ -38,6 +38,7 @@ swift_library(
"//submodules/TelegramUI/Components/ContextReferenceButtonComponent",
"//submodules/Svg",
"//submodules/PromptUI",
"//submodules/TelegramUI/Components/LottieComponent",
],
visibility = [
"//visibility:public",

View File

@@ -369,7 +369,7 @@ final class ReferenceButtonComponent: Component {
final class View: HighlightTrackingButton, ComponentTaggedView {
private let sourceView: ContextControllerSourceView
let referenceNode: ContextReferenceContentNode
private let componentView: ComponentView<Empty>
let componentView: ComponentView<Empty>
private var component: ReferenceButtonComponent?

View File

@@ -17,6 +17,7 @@ import MultilineTextComponent
import MinimizedContainer
import InstantPageUI
import NavigationStackComponent
import LottieComponent
private let settingsTag = GenericComponentViewTag()
@@ -125,9 +126,12 @@ private final class BrowserScreenComponent: CombinedComponent {
component: AnyComponent(
ReferenceButtonComponent(
content: AnyComponent(
BundleIconComponent(
name: "Instant View/Settings",
tintColor: environment.theme.rootController.navigationBar.primaryTextColor
LottieComponent(
content: LottieComponent.AppBundleContent(
name: "anim_moredots"
),
color: environment.theme.rootController.navigationBar.primaryTextColor,
size: CGSize(width: 30.0, height: 30.0)
)
),
tag: settingsTag,
@@ -150,7 +154,6 @@ private final class BrowserScreenComponent: CombinedComponent {
tintColor: environment.theme.rootController.navigationBar.primaryTextColor
)
),
tag: settingsTag,
action: {
performAction.invoke(isLoading ? .stop : .reload)
}
@@ -615,6 +618,10 @@ public class BrowserScreen: ViewController, MinimizableController {
guard let referenceView = self.componentHost.findTaggedView(tag: settingsTag) as? ReferenceButtonComponent.View else {
return
}
if let animationComponentView = referenceView.componentView.view as? LottieComponent.View {
animationComponentView.playOnce()
}
self.view.endEditing(true)

View File

@@ -389,7 +389,17 @@ final class StarsTransactionsListPanelComponent: Component {
let wasEmpty = self.items.isEmpty
let hadLocalTransactions = self.items.contains(where: { $0.flags.contains(.isLocal) })
self.items = status.transactions
var existingIds = Set<String>()
var filteredItems: [StarsContext.State.Transaction] = []
for transaction in status.transactions {
let id = transaction.extendedId
if !existingIds.contains(id) {
existingIds.insert(id)
filteredItems.append(transaction)
}
}
self.items = filteredItems
if !status.isLoading {
self.currentLoadMoreId = nil
}

View File

@@ -3121,11 +3121,11 @@ private final class ChatReadReportContextItemNode: ASDisplayNode, ContextMenuCus
}
let avatarsSize = self.avatarsNode.update(context: self.item.context, content: avatarsContent, itemSize: CGSize(width: 24.0, height: 24.0), customSpacing: 10.0, animated: false, synchronousLoad: true)
self.avatarsNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels(size.width - 28.0 - avatarsSize.width / 2.0), y: floor((size.height - avatarsSize.height) / 2.0)), size: avatarsSize)
self.avatarsNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels(size.width - sideInset - 2.0 - avatarsSize.width), y: floor((size.height - avatarsSize.height) / 2.0)), size: avatarsSize)
transition.updateAlpha(node: self.avatarsNode, alpha: self.currentStats == nil ? 0.0 : 1.0)
let placeholderAvatarsSize = self.placeholderAvatarsNode.update(context: self.item.context, content: placeholderAvatarsContent, itemSize: CGSize(width: 24.0, height: 24.0), customSpacing: 10.0, animated: false, synchronousLoad: true)
self.placeholderAvatarsNode.frame = CGRect(origin: CGPoint(x: size.width - sideInset - 8.0 - placeholderAvatarsSize.width, y: floor((size.height - placeholderAvatarsSize.height) / 2.0)), size: placeholderAvatarsSize)
self.placeholderAvatarsNode.frame = CGRect(origin: CGPoint(x: size.width - sideInset - 2.0 - placeholderAvatarsSize.width, y: floor((size.height - placeholderAvatarsSize.height) / 2.0)), size: placeholderAvatarsSize)
transition.updateAlpha(node: self.placeholderAvatarsNode, alpha: self.currentStats == nil ? 1.0 : 0.0)
transition.updateFrame(node: self.backgroundNode, frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: size.width, height: size.height)))