Skip to content

Commit ac47320

Browse files
committed
fix: crashing timer due to melt's missing trigger action.
1 parent ea72f24 commit ac47320

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/lib/components/shared/dialog.svelte

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@
2222
const { url, title = 'YouTube video player', children, inlineVideo = true }: Props = $props();
2323
</script>
2424

25-
<div
26-
class="contents cursor-pointer"
27-
use:melt={inlineVideo ? $trigger : null}
28-
onclick={() => {
29-
if (!inlineVideo && browser && window) {
30-
window.open(url, '_blank');
31-
}
32-
}}
33-
>
34-
{@render children()}
35-
</div>
25+
{#if inlineVideo}
26+
<div class="contents cursor-pointer" use:melt={$trigger}>
27+
{@render children()}
28+
</div>
29+
{:else}
30+
<div
31+
class="contents cursor-pointer"
32+
on:click={() => {
33+
if (browser && window) window.open(url, '_blank');
34+
}}
35+
>
36+
{@render children()}
37+
</div>
38+
{/if}
3639

3740
{#if $open}
3841
<div class="fixed inset-0 z-1000 flex items-center justify-center">

0 commit comments

Comments
 (0)