mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(web): migrate away from event dispatcher (#12802)
This commit is contained in:
parent
cfc575d89c
commit
94fc1f213a
18 changed files with 76 additions and 123 deletions
|
|
@ -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 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{#if !device.current}
|
||||
{#if !device.current && onDelete}
|
||||
<div>
|
||||
<CircleIconButton
|
||||
color="primary"
|
||||
icon={mdiTrashCanOutline}
|
||||
title={$t('log_out')}
|
||||
size="16"
|
||||
on:click={() => dispatcher('delete')}
|
||||
on:click={onDelete}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue