refs #3300 Handle shortcut keys in AddListMember

This commit is contained in:
AkiraFukushima 2022-05-03 18:13:57 +09:00
parent 9211d6e926
commit c2d0c42dbb
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 6 additions and 0 deletions

View File

@ -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