Show share if available

pull/2/head
Michael Scoff 7 years ago
parent 785b7df45a
commit 8a488ffda2
  1. 4
      Trust/Transactions/ViewControllers/TransactionViewController.swift
  2. 4
      Trust/Transactions/ViewModels/TransactionDetailsViewModel.swift

@ -63,7 +63,9 @@ class TransactionViewController: UIViewController {
displayChildViewController(viewController: stackViewController)
navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(share(_:)))
if viewModel.shareAvailable {
navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(share(_:)))
}
}
private func item(title: String, value: String) -> UIView {

@ -56,6 +56,10 @@ struct TransactionDetailsViewModel {
}
}
var shareAvailable: Bool {
return detailsAvailable
}
var detailsURL: URL {
return ConfigExplorer(server: config.server).transactionURL(for: transaction.id)
}

Loading…
Cancel
Save