Browse Source

feat(gui-v2): allow submitting delete modal with keypress

pull/2837/head
braks 2 years ago
parent
commit
44b30bf535
  1. 6
      packages/nc-gui-v2/components/dlg/ViewDelete.vue

6
packages/nc-gui-v2/components/dlg/ViewDelete.vue

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { notification } from 'ant-design-vue' import { notification } from 'ant-design-vue'
import { extractSdkResponseErrorMsg } from '~/utils' import { extractSdkResponseErrorMsg } from '~/utils'
import { useApi, useNuxtApp, useVModel } from '#imports' import { onKeyStroke, useApi, useNuxtApp, useVModel } from '#imports'
interface Props { interface Props {
modelValue: boolean modelValue: boolean
@ -23,6 +23,10 @@ const { api, isLoading } = useApi()
const { $e } = useNuxtApp() const { $e } = useNuxtApp()
onKeyStroke('Escape', () => (vModel.value = false))
onKeyStroke('Enter', () => onDelete())
/** Delete a view */ /** Delete a view */
async function onDelete() { async function onDelete() {
if (!props.view) return if (!props.view) return

Loading…
Cancel
Save