From 2a67eff841c665f3ae99d83b2d99bf4b3852dd53 Mon Sep 17 00:00:00 2001 From: Kylmakalle Date: Mon, 16 Jun 2025 15:57:26 +0300 Subject: [PATCH] WIP: Fixes --- .../Sources/ChatMessageShareButton.swift | 4 ++-- submodules/TelegramUI/Sources/ChatControllerContentData.swift | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageShareButton/Sources/ChatMessageShareButton.swift b/submodules/TelegramUI/Components/Chat/ChatMessageShareButton/Sources/ChatMessageShareButton.swift index 24e92fbf37..994eebabf1 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageShareButton/Sources/ChatMessageShareButton.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageShareButton/Sources/ChatMessageShareButton.swift @@ -152,11 +152,11 @@ public class ChatMessageShareButton: ASDisplayNode { } else if case let .customChatContents(contents) = subject, case .hashTagSearch = contents.kind { updatedIconImage = PresentationResourcesChat.chatFreeNavigateButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper) updatedIconOffset = CGPoint(x: UIScreenPixel, y: 1.0) + } else if let hasTranslation = hasTranslation /* MARK: Swiftgram */ { + updatedIconImage = PresentationResourcesChat.chatTranslateShareButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper, undoTranslate: hasTranslation) } else if isNavigate { updatedIconImage = PresentationResourcesChat.chatFreeNavigateToThreadButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper) updatedIconOffset = CGPoint(x: UIScreenPixel, y: -3.0) - } else if let hasTranslation = hasTranslation /* MARK: Swiftgram */ { - updatedIconImage = PresentationResourcesChat.chatTranslateShareButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper, undoTranslate: hasTranslation) } else if case .pinnedMessages = subject { updatedIconImage = PresentationResourcesChat.chatFreeNavigateButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper) updatedIconOffset = CGPoint(x: UIScreenPixel, y: 1.0) diff --git a/submodules/TelegramUI/Sources/ChatControllerContentData.swift b/submodules/TelegramUI/Sources/ChatControllerContentData.swift index 3e906e3290..0e6f5b64e6 100644 --- a/submodules/TelegramUI/Sources/ChatControllerContentData.swift +++ b/submodules/TelegramUI/Sources/ChatControllerContentData.swift @@ -2092,7 +2092,8 @@ extension ChatControllerImpl { return nil } } - |> distinctUntilChanged).startStrict(next: { [weak self] translationState in + |> distinctUntilChanged + |> deliverOnMainQueue).startStrict(next: { [weak self] translationState in if let strongSelf = self, let translationState = translationState, strongSelf.state.predictedChatLanguage == nil { let previousState = strongSelf.state