initializeConfirmationDialog.ts 565 B

1234567891011121314151617181920
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { whenever } from '@vueuse/shared'
  3. import { useConfirmation } from '#shared/composables/useConfirmation.ts'
  4. import { useDialog } from '../CommonDialog/useDialog.ts'
  5. export const initializeConfirmationDialog = () => {
  6. const { showConfirmation } = useConfirmation()
  7. const confirmationDialog = useDialog({
  8. name: 'confirmation',
  9. component: () => import('./CommonConfirmationDialog.vue'),
  10. })
  11. whenever(showConfirmation, () => {
  12. confirmationDialog.open()
  13. })
  14. }