ui: Don't reset the swap type if it's a valid option.

This commit is contained in:
tecnovert
2025-05-31 23:42:27 +02:00
parent 7ba2daf671
commit df4a6af6a0

View File

@@ -329,7 +329,9 @@ const SwapTypeManager = {
} else { } else {
swapTypeElement.disabled = false; swapTypeElement.disabled = false;
swapTypeElement.classList.remove('select-disabled'); 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'); 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 = { const UIEnhancer = {
handleErrorHighlighting: () => { handleErrorHighlighting: () => {
const errMsgs = document.querySelectorAll('p.error_msg'); const errMsgs = document.querySelectorAll('p.error_msg');