mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: refresh payment methods after user adds a payment method
If methods doesn't include the paymentMethodId, the Payment method input will show "No saved payment methods". Since paymentMethodId gets set after a user adds their payment method, we can listen for when it's set and fetch the methods if the newly added payment method isn't in the original list of payment methods.
This commit is contained in:
1 file changed
+8
@@ -255,6 +255,14 @@
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
// after adding a payment method, fetch the payment methods again so the input can be updated
|
||||
$: if (
|
||||
paymentMethodId &&
|
||||
!methods?.paymentMethods?.find((method) => method.$id === paymentMethodId)
|
||||
) {
|
||||
loadPaymentMethods();
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
||||
Reference in new issue
Block a user