chore(web): move BaseModal to callback pattern (#8696)

* chore(web): move BaseModal to callback to close

* chore: add question mark
This commit is contained in:
Ben
2024-04-11 09:01:16 +00:00
committed by GitHub
parent 8c9a092561
commit 37eea2d353
16 changed files with 37 additions and 45 deletions

View File

@@ -15,6 +15,7 @@
import SettingInputField, { SettingInputFieldType } from '../settings/setting-input-field.svelte';
import SettingSwitch from '../settings/setting-switch.svelte';
export let onClose: () => void;
export let albumId: string | undefined = undefined;
export let assetIds: string[] = [];
export let editingLink: SharedLinkResponseDto | undefined = undefined;
@@ -30,8 +31,6 @@
let enablePassword = false;
const dispatch = createEventDispatcher<{
close: void;
escape: void;
created: void;
}>();
@@ -146,7 +145,7 @@
message: 'Edited',
});
dispatch('close');
onClose();
} catch (error) {
handleError(error, 'Failed to edit shared link');
}
@@ -160,7 +159,7 @@
};
</script>
<BaseModal id="create-shared-link-modal" title={getTitle()} icon={mdiLink} on:close>
<BaseModal id="create-shared-link-modal" title={getTitle()} icon={mdiLink} {onClose}>
<section class="mx-6 mb-6">
{#if shareType === SharedLinkType.Album}
{#if !editingLink}