From 77c41c08c2c319a4272a4e478046de19f6585a44 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 10 Aug 2024 16:34:42 +0200 Subject: [PATCH] fix(js): hide conversion buttons if JavaScript enabled Removed event listeners on conversion buttons and instead hide them when JavaScript is enabled. This aims to improve the user experience by preventing redundant UI interactions that are handled dynamically. --- src/js/main.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/js/main.js b/src/js/main.js index a8eaf5a..63c5ab5 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -64,16 +64,9 @@ document.addEventListener('DOMContentLoaded', function () { } }); - // Add event listeners for the conversion buttons - convertXMRToFiatBtn.addEventListener('click', (e) => { - e.preventDefault(); - xmrConvert(); - }); - - convertFiatToXMRBtn.addEventListener('click', (e) => { - e.preventDefault(); - fiatConvert(); - }); + // Hide the conversion buttons if JavaScript is enabled + convertXMRToFiatBtn.style.display = 'none'; + convertFiatToXMRBtn.style.display = 'none'; // Fetch updated exchange rates immediately, then every 5 seconds fetchUpdatedExchangeRates();