Make prop calls not fail when there is no function
This commit is contained in:
parent
424c26e09e
commit
22867f269e
2 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
|||
let streamId = $state("doggoat");
|
||||
</script>
|
||||
|
||||
<Dialog close={() => close()}>
|
||||
<Dialog close={() => close?.()}>
|
||||
<div class="add-stream-dialog">
|
||||
{#if step === 0}
|
||||
<div class="step-0">
|
||||
|
@ -46,7 +46,7 @@
|
|||
>
|
||||
<button
|
||||
onclick={() => {
|
||||
add({ type, streamId });
|
||||
add?.({ type, streamId });
|
||||
step = 0;
|
||||
}}>Add</button
|
||||
>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
let { streams = $bindable(null), close } = $props();
|
||||
</script>
|
||||
|
||||
<Dialog close={() => close()}>
|
||||
<Dialog close={() => close?.()}>
|
||||
<pre>
|
||||
{JSON.stringify(streams)}
|
||||
</pre>
|
||||
|
|
Loading…
Reference in a new issue