mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various improvements
This commit is contained in:
@@ -1031,6 +1031,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
let botId = self.botId
|
||||
|
||||
let items = context.engine.messages.attachMenuBots()
|
||||
|> take(1)
|
||||
|> map { [weak self] attachMenuBots -> ContextController.Items in
|
||||
var items: [ContextMenuItem] = []
|
||||
|
||||
@@ -1039,8 +1040,8 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
if self?.url == nil, let attachMenuBot = attachMenuBot, attachMenuBot.hasSettings {
|
||||
items.append(.action(ContextMenuActionItem(text: presentationData.strings.WebApp_Settings, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Settings"), color: theme.contextMenu.primaryColor)
|
||||
}, action: { [weak self] _, f in
|
||||
f(.default)
|
||||
}, action: { [weak self] c, _ in
|
||||
c.dismiss(completion: nil)
|
||||
|
||||
if let strongSelf = self {
|
||||
strongSelf.controllerNode.sendSettingsButtonEvent()
|
||||
@@ -1051,8 +1052,8 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
if peerId != botId {
|
||||
items.append(.action(ContextMenuActionItem(text: presentationData.strings.WebApp_OpenBot, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Bots"), color: theme.contextMenu.primaryColor)
|
||||
}, action: { [weak self] _, f in
|
||||
f(.default)
|
||||
}, action: { [weak self] c, _ in
|
||||
c.dismiss(completion: nil)
|
||||
|
||||
if let strongSelf = self, let navigationController = strongSelf.getNavigationController() {
|
||||
strongSelf.dismiss()
|
||||
@@ -1063,8 +1064,8 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
|
||||
items.append(.action(ContextMenuActionItem(text: presentationData.strings.WebApp_ReloadPage, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Reload"), color: theme.contextMenu.primaryColor)
|
||||
}, action: { [weak self] _, f in
|
||||
f(.default)
|
||||
}, action: { [weak self] c, _ in
|
||||
c.dismiss(completion: nil)
|
||||
|
||||
self?.controllerNode.webView?.reload()
|
||||
})))
|
||||
@@ -1072,8 +1073,8 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
if let _ = attachMenuBot, self?.url == nil {
|
||||
items.append(.action(ContextMenuActionItem(text: presentationData.strings.WebApp_RemoveBot, textColor: .destructive, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor)
|
||||
}, action: { [weak self] _, f in
|
||||
f(.default)
|
||||
}, action: { [weak self] c, _ in
|
||||
c.dismiss(completion: nil)
|
||||
|
||||
if let strongSelf = self {
|
||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
|
||||
Reference in New Issue
Block a user