Skip to content

Commit

Permalink
Refactor unsafe chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwijos committed Jan 15, 2024
1 parent fe1a066 commit ae84f7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/(main)/me/account/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
export let data: PageData;
const [balance, balanceDecimals] = data?.balance?.toFixed(2).split('.');
const [balance, balanceDecimals] =
typeof data?.balance === 'number' ? data.balance.toFixed(2).split('.') : ['0', '00'];
</script>

<div class="space-y-8">
Expand Down

0 comments on commit ae84f7a

Please sign in to comment.