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