refs #3300 Handle shortcut keys in AddListMember
This commit is contained in:
parent
9211d6e926
commit
c2d0c42dbb
|
@ -38,6 +38,7 @@ import { defineComponent, computed, ref } from 'vue'
|
|||
import { Entity } from 'megalodon'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18next } from 'vue3-i18next'
|
||||
import { useMagicKeys, whenever } from '@vueuse/core'
|
||||
import { useStore } from '@/store'
|
||||
import { ACTION_TYPES } from '@/store/TimelineSpace/Modals/AddListMember'
|
||||
import { ACTION_TYPES as LIST_ACTION_TYPES } from '@/store/TimelineSpace/Contents/Lists/Edit'
|
||||
|
@ -48,6 +49,7 @@ export default defineComponent({
|
|||
const space = 'TimelineSpace/Modals/AddListMember'
|
||||
const store = useStore()
|
||||
const i18n = useI18next()
|
||||
const { enter } = useMagicKeys()
|
||||
|
||||
const name = ref<string>('')
|
||||
|
||||
|
@ -59,6 +61,10 @@ export default defineComponent({
|
|||
set: (value: boolean) => store.dispatch(`${space}/${ACTION_TYPES.CHANGE_MODAL}`, value)
|
||||
})
|
||||
|
||||
whenever(enter, () => {
|
||||
search()
|
||||
})
|
||||
|
||||
const username = (account: Entity.Account): string => {
|
||||
if (account.display_name !== '') {
|
||||
return account.display_name
|
||||
|
|
Loading…
Reference in New Issue