migrate: switch to svelte 5 events system for everything

This commit is contained in:
James Xylight committed 2025-02-05 19:29:54 -08:00
1 parent 43a857ed66
commit 53cb0e4f20
27 files changed
+248 -303

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@
<div animate:flip={{ duration: 500, easing: expoInOut }}>
<PictrsImage
image={image.local_image}
on:delete={() => {
ondelete={() => {
data.images = data.images.toSpliced(
data.images.findIndex(
(i) =>
+3 -4
View File
@@ -11,8 +11,6 @@
import { createEventDispatcher } from 'svelte'
import { ArrowDown, ArrowDownTray, Icon, Trash } from 'svelte-hero-icons'
const dispatch = createEventDispatcher<{ delete: boolean }>()
let loading = $state(false)
async function deleteImage(image: LocalImage) {
@@ -25,7 +23,7 @@
filename: image.pictrs_alias,
})
dispatch('delete', res)
ondelete?.(res)
} catch (e) {
toast({ content: e as any, type: 'error' })
}
@@ -34,9 +32,10 @@
interface Props {
image: LocalImage
ondelete?: (res: boolean) => void
}
let { image }: Props = $props()
let { image, ondelete }: Props = $props()
</script>
<div class="flex flex-col gap-1">