From a70c839fb488a4a482d12479eed715aa6bd9a661 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 10 Sep 2023 15:38:18 +0400 Subject: [PATCH] Web app improvements --- Telegram/Telegram-iOS/en.lproj/Localizable.strings | 2 ++ .../GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift | 6 ++++++ submodules/WebUI/Sources/WebAppController.swift | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index bfd9d0aceb..95647dc58e 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -9967,3 +9967,5 @@ Sorry for the inconvenience."; "SessionReview.Title" = "New Login Prevented"; "SessionReview.Text" = "We have terminated the login attempt from **%1$@**, **%2$@**"; "SessionReview.OkAction" = "Got it"; + +"WebApp.RemoveAllConfirmationText" = "This will remove **%@** shortcuts from all menus."; diff --git a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift index 3ea942acae..411c2b64a3 100644 --- a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift @@ -1690,6 +1690,12 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode { self.hideStatusNodeUntilCentrality = false self.statusButtonNode.isHidden = self.hideStatusNodeUntilCentrality || self.statusNodeShouldBeHidden videoNode.playOnceWithSound(playAndRecord: false, seek: seek, actionAtEnd: self.actionAtEnd) + + Queue.mainQueue().after(1.0, { + if let item = self.item, item.isSecret, !self.isPlaying { + videoNode.playOnceWithSound(playAndRecord: false, seek: .start, actionAtEnd: self.actionAtEnd) + } + }) } } } diff --git a/submodules/WebUI/Sources/WebAppController.swift b/submodules/WebUI/Sources/WebAppController.swift index 4319ea2e02..82f5f4f6f7 100644 --- a/submodules/WebUI/Sources/WebAppController.swift +++ b/submodules/WebUI/Sources/WebAppController.swift @@ -1530,7 +1530,7 @@ public final class WebAppController: ViewController, AttachmentContainable { if let strongSelf = self { let presentationData = context.sharedContext.currentPresentationData.with { $0 } - strongSelf.present(textAlertController(context: context, title: presentationData.strings.WebApp_RemoveConfirmationTitle, text: presentationData.strings.WebApp_RemoveConfirmationText(strongSelf.botName).string, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { [weak self] in + strongSelf.present(textAlertController(context: context, title: presentationData.strings.WebApp_RemoveConfirmationTitle, text: presentationData.strings.WebApp_RemoveAllConfirmationText(strongSelf.botName).string, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { [weak self] in if let strongSelf = self { let _ = context.engine.messages.removeBotFromAttachMenu(botId: strongSelf.botId).start() strongSelf.dismiss()