mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore: migrate away from event dispatcher (#12820)
This commit is contained in:
parent
529d49471f
commit
124eb8251b
72 changed files with 360 additions and 656 deletions
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue