mirror of
https://github.com/immich-app/immich.git
synced 2025-11-26 12:39:44 +09:00
chore: migrate away from event dispatcher (#12820)
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
import { handleError } from '$lib/utils/handle-error';
|
||||
import { SharedLinkType, createSharedLink, updateSharedLink, type SharedLinkResponseDto } from '@immich/sdk';
|
||||
import { mdiContentCopy, mdiLink } from '@mdi/js';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { NotificationType, notificationController } from '../notification/notification';
|
||||
import SettingInputField, { SettingInputFieldType } from '../settings/setting-input-field.svelte';
|
||||
import SettingSwitch from '../settings/setting-switch.svelte';
|
||||
@@ -21,6 +20,7 @@
|
||||
export let albumId: string | undefined = undefined;
|
||||
export let assetIds: string[] = [];
|
||||
export let editingLink: SharedLinkResponseDto | undefined = undefined;
|
||||
export let onCreated: () => void = () => {};
|
||||
|
||||
let sharedLink: string | null = null;
|
||||
let description = '';
|
||||
@@ -32,10 +32,6 @@
|
||||
let shouldChangeExpirationTime = false;
|
||||
let enablePassword = false;
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
created: void;
|
||||
}>();
|
||||
|
||||
const expirationOptions: [number, Intl.RelativeTimeFormatUnit][] = [
|
||||
[30, 'minutes'],
|
||||
[1, 'hour'],
|
||||
@@ -97,7 +93,7 @@
|
||||
},
|
||||
});
|
||||
sharedLink = makeSharedLinkUrl($serverConfig.externalDomain, data.key);
|
||||
dispatch('created');
|
||||
onCreated();
|
||||
} catch (error) {
|
||||
handleError(error, $t('errors.failed_to_create_shared_link'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user