mirror of
https://github.com/immich-app/immich.git
synced 2025-11-28 07:49:52 +09:00
chore: migrate away from event dispatcher (#12820)
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
import { handleError } from '$lib/utils/handle-error';
|
||||
import { updateUserAdmin, type UserAdminResponseDto } from '@immich/sdk';
|
||||
import { mdiAccountEditOutline } from '@mdi/js';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import Button from '../elements/buttons/button.svelte';
|
||||
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
|
||||
import { t } from 'svelte-i18n';
|
||||
@@ -15,6 +14,8 @@
|
||||
export let canResetPassword = true;
|
||||
export let newPassword: string;
|
||||
export let onClose: () => void;
|
||||
export let onResetPasswordSuccess: () => void;
|
||||
export let onEditSuccess: () => void;
|
||||
|
||||
let error: string;
|
||||
let success: string;
|
||||
@@ -27,12 +28,6 @@
|
||||
!!quotaSize &&
|
||||
convertToBytes(Number(quotaSize), ByteUnit.GiB) > $serverInfo.diskSizeRaw;
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
close: void;
|
||||
resetPasswordSuccess: void;
|
||||
editSuccess: void;
|
||||
}>();
|
||||
|
||||
const editUser = async () => {
|
||||
try {
|
||||
const { id, email, name, storageLabel } = user;
|
||||
@@ -46,7 +41,7 @@
|
||||
},
|
||||
});
|
||||
|
||||
dispatch('editSuccess');
|
||||
onEditSuccess();
|
||||
} catch (error) {
|
||||
handleError(error, $t('errors.unable_to_update_user'));
|
||||
}
|
||||
@@ -72,7 +67,7 @@
|
||||
},
|
||||
});
|
||||
|
||||
dispatch('resetPasswordSuccess');
|
||||
onResetPasswordSuccess();
|
||||
} catch (error) {
|
||||
handleError(error, $t('errors.unable_to_reset_password'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user