Skip to content

Commit

Permalink
fix: observer
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmanNik committed Dec 19, 2023
1 parent 9c362e9 commit b66740f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/lib/components/billing/paymentBoxes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
}
}
});
observer.observe(element, { childList: true });
});
onDestroy(() => {
observer.disconnect();
});
$: if (element) {
observer.observe(element, { childList: true });
}
</script>

<RadioBoxes elements={methods} total={methods?.length} variableName="$id" name="payment" bind:group>
Expand Down
6 changes: 4 additions & 2 deletions src/routes/console/account/payments/paymentModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@
}
}
});
observer.observe(element, { childList: true });
});
onDestroy(() => {
observer.disconnect();
document.documentElement.classList.remove('u-overflow-hidden');
});
$: if (element) {
observer.observe(element, { childList: true });
}
</script>

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

0 comments on commit b66740f

Please sign in to comment.