Skip to content

Commit b66740f

Browse files
committed
fix: observer
1 parent 9c362e9 commit b66740f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/lib/components/billing/paymentBoxes.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@
2929
}
3030
}
3131
});
32-
33-
observer.observe(element, { childList: true });
3432
});
3533
3634
onDestroy(() => {
3735
observer.disconnect();
3836
});
37+
38+
$: if (element) {
39+
observer.observe(element, { childList: true });
40+
}
3941
</script>
4042

4143
<RadioBoxes elements={methods} total={methods?.length} variableName="$id" name="payment" bind:group>

src/routes/console/account/payments/paymentModal.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@
5555
}
5656
}
5757
});
58-
59-
observer.observe(element, { childList: true });
6058
});
6159
6260
onDestroy(() => {
6361
observer.disconnect();
6462
document.documentElement.classList.remove('u-overflow-hidden');
6563
});
64+
65+
$: if (element) {
66+
observer.observe(element, { childList: true });
67+
}
6668
</script>
6769

6870
<FakeModal bind:show title="Add payment method" bind:error onSubmit={handleSubmit}>

0 commit comments

Comments
 (0)