diff --git a/src/components/TransferGuestDialog.vue b/src/components/TransferGuestDialog.vue index 1308e4ec..9445dffb 100644 --- a/src/components/TransferGuestDialog.vue +++ b/src/components/TransferGuestDialog.vue @@ -112,7 +112,7 @@ export default defineComponent({ }) this.$emit('close', this.userId) } catch (error) { - this.$emit('close', null) + this.$emit('close', false) } this.loading = false }, diff --git a/src/users.ts b/src/users.ts index 94d3d0b8..bb4b1b14 100644 --- a/src/users.ts +++ b/src/users.ts @@ -14,11 +14,14 @@ import SvgAccountArrowRight from '@mdi/svg/svg/account-arrow-right.svg?raw' import TransferGuestDialog from './components/TransferGuestDialog.vue' const transferGuest = (_event: MouseEvent, user: User): void => { - const onClose = (userId: null | string) => { - if (!userId) { + const onClose = (userId: false | null | string) => { + if (userId === false) { showError(t('guests', 'Failed to transfer guest')) return } + if (userId === null) { // Transfer is cancelled so we return silently + return + } showSuccess(t('guests', 'Guest transferred to new account "{userId}"', { userId })) emit('guests:user:deleted', user.id as string) emit('guests:user:created', userId)