mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
feat(schedule): action to delete scheduled messages
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
91f3fbb1d6
commit
0066ae52f6
1 changed files with 17 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import IconCheck from 'vue-material-design-icons/Check.vue'
|
|||
import IconDotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue'
|
||||
import IconPencilOutline from 'vue-material-design-icons/PencilOutline.vue'
|
||||
import IconSendVariantClock from 'vue-material-design-icons/SendVariantClock.vue'
|
||||
import IconTrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'
|
||||
import { useChatExtrasStore } from '../../../../../stores/chatExtras.ts'
|
||||
import { convertToUnix, formatDateTime } from '../../../../../utils/formattedTime.ts'
|
||||
import { getCustomDateOptions } from '../../../../../utils/getCustomDateOptions.ts'
|
||||
|
|
@ -65,6 +66,13 @@ async function handleReschedule(timestamp: number) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the scheduled message
|
||||
*/
|
||||
async function handleDelete() {
|
||||
await chatExtrasStore.deleteScheduledMessage(props.message.token, props.message.id)
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle action menu open state
|
||||
*/
|
||||
|
|
@ -130,6 +138,15 @@ function onMenuClose() {
|
|||
</template>
|
||||
{{ t('spreed', 'Edit message') }}
|
||||
</NcActionButton>
|
||||
<NcActionButton
|
||||
key="delete-message"
|
||||
close-after-click
|
||||
@click.stop="handleDelete">
|
||||
<template #icon>
|
||||
<IconTrashCanOutline :size="20" />
|
||||
</template>
|
||||
{{ t('spreed', 'Delete') }}
|
||||
</NcActionButton>
|
||||
</template>
|
||||
|
||||
<template v-else-if="submenu === 'schedule'">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue