Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

order webxdc-menu by usage #2604

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Delta Chat iOS Changelog

## Unreleased
2025-02

- Tweak menu order (#2604)


## v1.54.0
2025-02

Expand Down
16 changes: 9 additions & 7 deletions deltachat-ios/Controller/WebxdcViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,14 @@ class WebxdcViewController: WebViewViewController {
private func moreButtonMenu() -> UIMenu {
func actions() -> [UIMenuElement] {
var actions = [UIMenuElement]()
actions.append(UIAction(title: String.localized("show_in_chat"), image: UIImage(systemName: "doc.text.magnifyingglass")) { [weak self] _ in
guard let self, let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
let message = dcContext.getMessage(id: self.messageId)
DispatchQueue.main.async {
appDelegate.appCoordinator.showChat(chatId: message.chatId, msgId: message.id, animated: true, clearViewControllerStack: true)
}
})

if #available(iOS 17.0, *), let userDefaults = UserDefaults.shared {
let appsInWidgetsMessageIds = userDefaults.getAppWidgetEntries().compactMap { entry in
switch entry.type {
Expand All @@ -444,13 +452,7 @@ class WebxdcViewController: WebViewViewController {
})
}
}
actions.append(UIAction(title: String.localized("show_in_chat"), image: UIImage(systemName: "doc.text.magnifyingglass")) { [weak self] _ in
guard let self, let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
let message = dcContext.getMessage(id: self.messageId)
DispatchQueue.main.async {
appDelegate.appCoordinator.showChat(chatId: message.chatId, msgId: message.id, animated: true, clearViewControllerStack: true)
}
})

if sourceCodeUrl != nil {
actions.append(UIMenu(options: [.displayInline],
children: [
Expand Down
Loading