Skip to content

Commit c875368

Browse files
authored
fix: initial buyerInfo not registered correctly (#124)
1 parent c093f7c commit c875368

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

packages/payment-widget/src/lib/payment-widget.svelte

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,17 @@
4545
let selectedCurrency: Currency | null = null;
4646
let connectionCheckInterval: ReturnType<typeof setInterval> | null = null;
4747
let currentPaymentStep: PaymentStep = "currency";
48-
let currentBuyerInfo: BuyerInfo = buyerInfo || {
49-
address: {},
50-
};
48+
5149
let scrollPosition = 0;
5250
5351
// Effects
5452
$: currencyDetails = getSupportedCurrencies(supportedCurrencies);
5553
5654
$: isConnected = false;
5755
$: isModalOpen = false;
56+
$: currentBuyerInfo = buyerInfo || {
57+
address: {},
58+
};
5859
5960
$: {
6061
if (isModalOpen && !isConnected) {
@@ -72,6 +73,16 @@
7273
7374
$: toggleBodyScroll(isModalOpen);
7475
76+
$: {
77+
if (buyerInfo) {
78+
currentBuyerInfo = buyerInfo;
79+
} else {
80+
currentBuyerInfo = {
81+
address: {},
82+
};
83+
}
84+
}
85+
7586
// Methods
7687
async function checkConnectionStatus() {
7788
if (isCheckingConnection) return;

0 commit comments

Comments
 (0)