diff --git a/src/lib/components/CoinBalance.svelte b/src/lib/components/CoinBalance.svelte index 2b9452907..f297bd575 100644 --- a/src/lib/components/CoinBalance.svelte +++ b/src/lib/components/CoinBalance.svelte @@ -22,7 +22,6 @@ // Get the cursor's position relative to the viewport const x = event.clientX const y = event.clientY - console.log(x, y) WalletStore.openWallet([y, x]) } } diff --git a/src/lib/components/wallet/CurrencySelector.svelte b/src/lib/components/wallet/CurrencySelector.svelte index bb4807f6b..2d8e20a0c 100644 --- a/src/lib/components/wallet/CurrencySelector.svelte +++ b/src/lib/components/wallet/CurrencySelector.svelte @@ -15,9 +15,11 @@ } function selectCurrency(currency: Currency) { - selectedCurrency = currency - showCurrencyOptions = false - dispatch("currencySelected", currency) + if (currency.enabled) { + selectedCurrency = currency + showCurrencyOptions = false + dispatch("currencySelected", currency) + } } function handleClickOutside(event: MouseEvent) { @@ -34,6 +36,13 @@ onDestroy(() => { document.removeEventListener("click", handleClickOutside) }) + + // Sort currencies: enabled first, then disabled + $: sortedCurrencies = currencies.slice().sort((a, b) => { + if (a.enabled === b.enabled) return 0 + if (a.enabled) return -1 + return 1 + }) @@ -47,9 +56,9 @@ {#if showCurrencyOptions}