mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 18:12:44 +02:00
Implement toast messages when links are copied
This commit is contained in:
@@ -158,6 +158,8 @@ final class ThreadListViewController: UIViewController {
|
||||
renderShowingLongPressActions()
|
||||
case .share(let string):
|
||||
renderShare(string)
|
||||
case .toastForCopyLink:
|
||||
toastForCopyLink()
|
||||
case .error(let error):
|
||||
render(error: error)
|
||||
}
|
||||
@@ -256,6 +258,11 @@ final class ThreadListViewController: UIViewController {
|
||||
present(activityVC, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
private func toastForCopyLink() {
|
||||
view.vc_toast(message: VectorL10n.roomEventCopyLinkInfo,
|
||||
image: Asset.Images.linkIcon.image)
|
||||
}
|
||||
|
||||
private func render(error: Error) {
|
||||
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
|
||||
self.errorPresenter.presentError(from: self, forError: error, animated: true, handler: nil)
|
||||
|
||||
@@ -295,6 +295,7 @@ final class ThreadListViewModel: ThreadListViewModelProtocol {
|
||||
}
|
||||
if let permalink = MXTools.permalink(toEvent: thread.id, inRoom: thread.roomId) {
|
||||
MXKPasteboardManager.shared.pasteboard.string = permalink
|
||||
viewState = .toastForCopyLink
|
||||
}
|
||||
longPressedThread = nil
|
||||
}
|
||||
|
||||
@@ -27,5 +27,6 @@ enum ThreadListViewState {
|
||||
case showingFilterTypes
|
||||
case showingLongPressActions
|
||||
case share(_ string: String)
|
||||
case toastForCopyLink
|
||||
case error(Error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user