diff --git a/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte b/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte index e8490339a6..a2fbbe787a 100644 --- a/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte +++ b/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte @@ -1,25 +1,21 @@
dispatch('command', { command: JobCommand.ClearFailed, force: false })} + on:click={() => onCommand({ command: JobCommand.ClearFailed, force: false })} />
@@ -117,54 +116,42 @@ dispatch('command', { command: JobCommand.Start, force: false })} + on:click={() => onCommand({ command: JobCommand.Start, force: false })} > {$t('disabled').toUpperCase()} {:else if !isIdle} {#if waitingCount > 0} - dispatch('command', { command: JobCommand.Empty, force: false })}> + onCommand({ command: JobCommand.Empty, force: false })}> {$t('clear').toUpperCase()} {/if} {#if queueStatus.isPaused} {@const size = waitingCount > 0 ? '24' : '48'} - dispatch('command', { command: JobCommand.Resume, force: false })} - > + onCommand({ command: JobCommand.Resume, force: false })}> {$t('resume').toUpperCase()} {:else} - dispatch('command', { command: JobCommand.Pause, force: false })} - > + onCommand({ command: JobCommand.Pause, force: false })}> {$t('pause').toUpperCase()} {/if} {:else if allowForceCommand} - dispatch('command', { command: JobCommand.Start, force: true })}> + onCommand({ command: JobCommand.Start, force: true })}> {allText} - dispatch('command', { command: JobCommand.Start, force: false })} - > + onCommand({ command: JobCommand.Start, force: false })}> {missingText} {:else} - dispatch('command', { command: JobCommand.Start, force: false })} - > + onCommand({ command: JobCommand.Start, force: false })}> {$t('start').toUpperCase()} diff --git a/web/src/lib/components/admin-page/jobs/jobs-panel.svelte b/web/src/lib/components/admin-page/jobs/jobs-panel.svelte index cd9855eea2..6de3112ad5 100644 --- a/web/src/lib/components/admin-page/jobs/jobs-panel.svelte +++ b/web/src/lib/components/admin-page/jobs/jobs-panel.svelte @@ -163,7 +163,7 @@ {allowForceCommand} {jobCounts} {queueStatus} - on:command={({ detail }) => (handleCommandOverride || handleCommand)(jobName, detail)} + onCommand={(command) => (handleCommandOverride || handleCommand)(jobName, command)} /> {/each} diff --git a/web/src/lib/components/admin-page/restore-dialogue.svelte b/web/src/lib/components/admin-page/restore-dialogue.svelte index 9b274d2c2f..25afbc6d4b 100644 --- a/web/src/lib/components/admin-page/restore-dialogue.svelte +++ b/web/src/lib/components/admin-page/restore-dialogue.svelte @@ -3,28 +3,24 @@ import ConfirmDialog from '$lib/components/shared-components/dialog/confirm-dialog.svelte'; import { handleError } from '$lib/utils/handle-error'; import { restoreUserAdmin, type UserResponseDto } from '@immich/sdk'; - import { createEventDispatcher } from 'svelte'; import { t } from 'svelte-i18n'; export let user: UserResponseDto; - - const dispatch = createEventDispatcher<{ - success: void; - fail: void; - cancel: void; - }>(); + export let onSuccess: () => void; + export let onFail: () => void; + export let onCancel: () => void; const handleRestoreUser = async () => { try { const { deletedAt } = await restoreUserAdmin({ id: user.id }); if (deletedAt == undefined) { - dispatch('success'); + onSuccess(); } else { - dispatch('fail'); + onFail(); } } catch (error) { handleError(error, $t('errors.unable_to_restore_user')); - dispatch('fail'); + onFail(); } }; @@ -34,7 +30,7 @@ confirmText={$t('continue')} confirmColor="green" onConfirm={handleRestoreUser} - onCancel={() => dispatch('cancel')} + {onCancel} >

diff --git a/web/src/lib/components/elements/slider.svelte b/web/src/lib/components/elements/slider.svelte index 68b085fb91..efe67fda9c 100644 --- a/web/src/lib/components/elements/slider.svelte +++ b/web/src/lib/components/elements/slider.svelte @@ -1,6 +1,4 @@

{#each colors as color} - {/each} diff --git a/web/src/lib/components/shared-components/settings/setting-switch.svelte b/web/src/lib/components/shared-components/settings/setting-switch.svelte index d933b27ab5..24b539f0a1 100644 --- a/web/src/lib/components/shared-components/settings/setting-switch.svelte +++ b/web/src/lib/components/shared-components/settings/setting-switch.svelte @@ -43,11 +43,5 @@
- onToggle(detail)} - ariaDescribedBy={subtitleId} - /> +
diff --git a/web/src/lib/components/shared-components/show-shortcuts.svelte b/web/src/lib/components/shared-components/show-shortcuts.svelte index ebc0dd688c..2bd1b8976b 100644 --- a/web/src/lib/components/shared-components/show-shortcuts.svelte +++ b/web/src/lib/components/shared-components/show-shortcuts.svelte @@ -1,9 +1,8 @@ - dispatch('close')}> +
{#if shortcuts.general.length > 0}
diff --git a/web/src/lib/components/user-settings-page/device-card.svelte b/web/src/lib/components/user-settings-page/device-card.svelte index 676e984364..d43977ea08 100644 --- a/web/src/lib/components/user-settings-page/device-card.svelte +++ b/web/src/lib/components/user-settings-page/device-card.svelte @@ -15,14 +15,10 @@ mdiUbuntu, } from '@mdi/js'; import { DateTime, type ToRelativeCalendarOptions } from 'luxon'; - import { createEventDispatcher } from 'svelte'; import { t } from 'svelte-i18n'; export let device: SessionResponseDto; - - const dispatcher = createEventDispatcher<{ - delete: void; - }>(); + export let onDelete: (() => void) | undefined = undefined; const options: ToRelativeCalendarOptions = { unit: 'days', @@ -68,14 +64,14 @@
- {#if !device.current} + {#if !device.current && onDelete}
dispatcher('delete')} + on:click={onDelete} />
{/if} diff --git a/web/src/lib/components/user-settings-page/device-list.svelte b/web/src/lib/components/user-settings-page/device-list.svelte index 57299bb46f..26e03c35d8 100644 --- a/web/src/lib/components/user-settings-page/device-list.svelte +++ b/web/src/lib/components/user-settings-page/device-list.svelte @@ -68,7 +68,7 @@ {$t('other_devices').toUpperCase()} {#each otherDevices as device, index} - handleDelete(device)} /> + handleDelete(device)} /> {#if index !== otherDevices.length - 1}
{/if} diff --git a/web/src/lib/components/user-settings-page/partner-selection-modal.svelte b/web/src/lib/components/user-settings-page/partner-selection-modal.svelte index 3cff1cd1de..8ab747aa27 100644 --- a/web/src/lib/components/user-settings-page/partner-selection-modal.svelte +++ b/web/src/lib/components/user-settings-page/partner-selection-modal.svelte @@ -1,19 +1,18 @@