diff --git a/dashboard/src/components/InvitationDialog.vue b/dashboard/src/components/InvitationDialog.vue index 2dd260f19..5007ac8ed 100644 --- a/dashboard/src/components/InvitationDialog.vue +++ b/dashboard/src/components/InvitationDialog.vue @@ -5,10 +5,12 @@ const i18n = useI18n(); const t = i18n.t; import { ref, useTemplateRef } from 'vue'; -import { Dialog, TextInput, EmailInput, FormGroup, Button, InputGroup, Spinner } from '@cloudron/pankow'; +import { Dialog, TextInput, EmailInput, FormGroup, Button, InputGroup, ProgressBar } from '@cloudron/pankow'; import { copyToClipboard } from '@cloudron/pankow/utils'; import UsersModel from '../models/UsersModel.js'; +const emit = defineEmits([ 'refreshRequired' ]); + const usersModel = UsersModel.create(); const dialog = useTemplateRef('dialog'); @@ -44,7 +46,16 @@ defineExpose({ dialog.value.open(); const [error, result] = await usersModel.inviteLink(u.id); - if (error) return console.error(error); + if (error) { + if (error.status === 409) { + emit('refreshRequired'); + dialog.value.close(); + } else { + console.error(error); + } + + return; + } inviteLink.value = result; } }); @@ -59,7 +70,7 @@ defineExpose({ >
- +
diff --git a/dashboard/src/views/UsersView.vue b/dashboard/src/views/UsersView.vue index 429cf6872..20b45b822 100644 --- a/dashboard/src/views/UsersView.vue +++ b/dashboard/src/views/UsersView.vue @@ -226,7 +226,7 @@ onMounted(async () => { - +