Tweak Posted Successfully toast
This commit is contained in:
parent
85a9f9fb49
commit
57e21176f0
@ -132,13 +132,21 @@ class ComposeHostingController: UIHostingController<ComposeHostingController.Vie
|
||||
if let presentingViewController,
|
||||
let host = findNavDelegate(in: presentingViewController) {
|
||||
_ = mastodonController.persistentContainer.addOrUpdateOnViewContext(status: status)
|
||||
var config = ToastConfiguration(title: "Posted Successfully")
|
||||
config.actionTitle = "View"
|
||||
let title = switch mode {
|
||||
case .edit(_): "Edited Successfully"
|
||||
case .post(_): "Posted Successfully"
|
||||
default: fatalError()
|
||||
}
|
||||
var config = ToastConfiguration(title: title)
|
||||
config.dismissAutomaticallyAfter = 5
|
||||
config.systemImageName = "checkmark"
|
||||
if case .post(_) = mode {
|
||||
config.actionTitle = "View"
|
||||
config.action = { toast in
|
||||
host.selected(status: status.id)
|
||||
toast.dismissToast(animated: true)
|
||||
}
|
||||
}
|
||||
host.showToast(configuration: config, animated: true)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user