Skip to content

Commit

Permalink
Disable swaps on FE (#4920)
Browse files Browse the repository at this point in the history
  • Loading branch information
megrogan authored Dec 4, 2023
1 parent 82d27ed commit 564b4f7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions frontend/app/src/components/home/profile/Accounts.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import ChevronDown from "svelte-material-icons/ChevronDown.svelte";
import ArrowRightBoldCircle from "svelte-material-icons/ArrowRightBoldCircle.svelte";
import ArrowLeftBoldCircle from "svelte-material-icons/ArrowLeftBoldCircle.svelte";
import SwapIcon from "svelte-material-icons/SwapHorizontal.svelte";
//import SwapIcon from "svelte-material-icons/SwapHorizontal.svelte";
import ViewList from "svelte-material-icons/ViewList.svelte";
import { _ } from "svelte-i18n";
import ErrorMessage from "../../ErrorMessage.svelte";
Expand All @@ -33,7 +33,11 @@
$: accounts = client.enhancedCryptoLookup;
$: nervousSystemLookup = client.nervousSystemLookup;
$: snsLedgers = new Set<string>(Object.values($nervousSystemLookup).filter((ns) => !ns.isNns).map((ns) => ns.ledgerCanisterId));
$: snsLedgers = new Set<string>(
Object.values($nervousSystemLookup)
.filter((ns) => !ns.isNns)
.map((ns) => ns.ledgerCanisterId),
);
$: {
zeroCount = Object.values($accounts).filter((a) => a.zero).length;
Expand Down Expand Up @@ -61,10 +65,10 @@
manageMode = "send";
}
function showSwap(ledger: string) {
selectedLedger = ledger;
manageMode = "swap";
}
// function showSwap(ledger: string) {
// selectedLedger = ledger;
// manageMode = "swap";
// }
</script>

{#if manageMode !== "none" && selectedLedger !== undefined}
Expand Down Expand Up @@ -122,7 +126,7 @@
slot="icon" />
<div slot="text">{$_("cryptoAccount.receive")}</div>
</MenuItem>
{#await client.getTokenSwaps(token.ledger) then swaps}
<!-- {#await client.getTokenSwaps(token.ledger) then swaps}
{#if Object.keys(swaps).length > 0}
<MenuItem on:click={() => showSwap(token.ledger)}>
<SwapIcon
Expand All @@ -132,7 +136,7 @@
<div slot="text">{$_("cryptoAccount.swap")}</div>
</MenuItem>
{/if}
{/await}
{/await} -->
{#if snsLedgers.has(token.ledger)}
<MenuItem on:click={() => (transactionsFor = token)}>
<ViewList
Expand Down

0 comments on commit 564b4f7

Please sign in to comment.