Revert "Add redaction menu (disabled)."

This reverts commit bd4a698f8b.
This commit is contained in:
Doug
2022-09-14 09:44:15 +01:00
parent bd4a698f8b
commit 2986f85bcb
12 changed files with 10 additions and 78 deletions
@@ -23,7 +23,6 @@ enum TimelineItemContextMenuAction: Hashable {
case copy
case quote
case copyPermalink
case redact
}
enum RoomScreenViewAction {
@@ -116,16 +116,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
return []
}
let actions: [TimelineItemContextMenuAction] = [
.copy, .quote, .copyPermalink
]
#warning("Outgoing actions to be handled with the new Timeline API.")
// if timelineItem.isOutgoing {
// actions.append(.redact)
// }
return actions
return [.copy, .quote, .copyPermalink]
}
private func processContentMenuAction(_ action: TimelineItemContextMenuAction, itemId: String) {
@@ -146,8 +137,6 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
} catch {
displayError(.alert(ElementL10n.roomTimelinePermalinkCreationFailure))
}
case .redact:
redactItem(itemId)
}
}
@@ -159,10 +148,4 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
message: message)
}
}
private func redactItem(_ itemID: String) {
Task {
await timelineController.redactItem(itemID)
}
}
}
@@ -25,20 +25,16 @@ public struct TimelineItemContextMenu: View {
ForEach(contextMenuActions, id: \.self) { item in
switch item {
case .copy:
Button { callback(item) } label: {
Label(ElementL10n.actionCopy, systemImage: "doc.on.doc")
Button(ElementL10n.actionCopy) {
callback(item)
}
case .quote:
Button { callback(item) } label: {
Label(ElementL10n.actionQuote, systemImage: "quote.bubble")
Button(ElementL10n.actionQuote) {
callback(item)
}
case .copyPermalink:
Button { callback(item) } label: {
Label(ElementL10n.permalink, systemImage: "link")
}
case .redact:
Button(role: .destructive) { callback(item) } label: {
Label(ElementL10n.messageActionItemRedact, systemImage: "trash")
Button(ElementL10n.permalink) {
callback(item)
}
}
}