From abedfe62df5e1d16373d9cdc02140aceb4963c84 Mon Sep 17 00:00:00 2001 From: Sebin Song Date: Sat, 22 Jun 2024 09:35:35 +1200 Subject: [PATCH] #2089 - Remove 'Edit poll' menu (#2090) * remove edit poll menu * remove unused constants * fix the linter err * restore delete option --- frontend/views/containers/chatroom/MessageActions.vue | 5 +++-- frontend/views/containers/chatroom/MessageBase.vue | 11 ++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/views/containers/chatroom/MessageActions.vue b/frontend/views/containers/chatroom/MessageActions.vue index 3de90e59d..4207de791 100644 --- a/frontend/views/containers/chatroom/MessageActions.vue +++ b/frontend/views/containers/chatroom/MessageActions.vue @@ -164,10 +164,11 @@ export default ({ return this.isText || this.isPoll }, isEditable () { - return this.isMsgSender && (this.isText || this.isPoll) + return this.isMsgSender && this.isText }, isDeletable () { - return this.isEditable || this.isGroupCreator + return this.isGroupCreator || + (this.isMsgSender && (this.isText || this.isPoll)) } }, methods: { diff --git a/frontend/views/containers/chatroom/MessageBase.vue b/frontend/views/containers/chatroom/MessageBase.vue index e1524de08..35cf9f982 100644 --- a/frontend/views/containers/chatroom/MessageBase.vue +++ b/frontend/views/containers/chatroom/MessageBase.vue @@ -116,10 +116,7 @@ import SendArea from './SendArea.vue' import ChatAttachmentPreview from './file-attachment/ChatAttachmentPreview.vue' import { humanDate } from '@model/contracts/shared/time.js' import { swapMentionIDForDisplayname } from '@model/contracts/shared/functions.js' -import { - MESSAGE_TYPES, - MESSAGE_VARIANTS -} from '@model/contracts/shared/constants.js' +import { MESSAGE_VARIANTS } from '@model/contracts/shared/constants.js' import { OPEN_TOUCH_LINK_HELPER } from '@utils/events.js' import { L, LTags } from '@common/common.js' @@ -201,11 +198,7 @@ export default ({ humanDate, swapMentionIDForDisplayname, editMessage () { - if (this.type === MESSAGE_TYPES.POLL) { - alert('TODO: implement editting a poll') - } else { - this.isEditing = true - } + this.isEditing = true }, onMessageEdited (newMessage) { this.isEditing = false