Skip to content

Commit

Permalink
chore: use switch
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Dec 27, 2024
1 parent e6fddbb commit 89a58d5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ export function Home() {
};

function switchBalanceState(): void {
if (balanceDisplayMode === "sats") {
useAppStore.getState().setBalanceDisplayMode("fiat");
} else if (balanceDisplayMode === "fiat") {
useAppStore.getState().setBalanceDisplayMode("hidden");
} else {
useAppStore.getState().setBalanceDisplayMode("sats");
switch (balanceDisplayMode) {
case "sats":
useAppStore.getState().setBalanceDisplayMode("fiat");
break;
case "fiat":
useAppStore.getState().setBalanceDisplayMode("hidden");
break;
default:
useAppStore.getState().setBalanceDisplayMode("sats");
break;
}
}

Expand Down

0 comments on commit 89a58d5

Please sign in to comment.