From df4a6af6a0648410177a12379d5f0754336fd375 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Sat, 31 May 2025 23:42:27 +0200 Subject: [PATCH] ui: Don't reset the swap type if it's a valid option. --- basicswap/static/js/new_offer.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/basicswap/static/js/new_offer.js b/basicswap/static/js/new_offer.js index beaecab..6716c2c 100644 --- a/basicswap/static/js/new_offer.js +++ b/basicswap/static/js/new_offer.js @@ -329,7 +329,9 @@ const SwapTypeManager = { } else { swapTypeElement.disabled = false; swapTypeElement.classList.remove('select-disabled'); - swapTypeElement.value = 'xmr_swap'; + if (['xmr_swap', 'seller_first'].includes(swapTypeElement.value) == false) { + swapTypeElement.value = 'xmr_swap'; + } } let swapTypeHidden = DOM.get('swap_type_hidden'); @@ -353,10 +355,6 @@ const SwapTypeManager = { } }; -function set_swap_type_enabled(coinFrom, coinTo, swapTypeElement) { - SwapTypeManager.setSwapTypeEnabled(coinFrom, coinTo, swapTypeElement); -} - const UIEnhancer = { handleErrorHighlighting: () => { const errMsgs = document.querySelectorAll('p.error_msg');