Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
manelgavalda committed Nov 12, 2023
1 parent cba198a commit bd11286
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/Livewire/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ public function reloadTokens()
{
$result = Http::get(config('tokens.api_url'))->object();

$tokens = collect($result->balances);

$this->tokens->shift();

$this->tokens->prepend(
$tokens->sortBy(fn ($token) => $token->price * $token->balance)
$tokens = collect($result->balances)->sortBy(fn ($token) => $token->price * $token->balance)
);

$this->balances['prices'][] = $result->ethereumPrice->usd;
Expand Down

0 comments on commit bd11286

Please sign in to comment.