Skip to content

Commit

Permalink
chore: update account label fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
borcherd committed Dec 6, 2024
1 parent b236a86 commit ee83c98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/marginfi-v2-ui/src/store/uiStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ const stateCreator: StateCreator<UiState, [], []> = (set, get) => ({
if (!response.ok) throw new Error(`Error fetching account label for ${account.address.toBase58()}`);

const { data } = await response.json();
return data.label || `Account ${accounts.findIndex((acc) => acc.address.equals(account.address)) + 1}`;
return data.label || `Account`;
} catch (error) {
console.error(error);
return `Account ${accounts.findIndex((acc) => acc.address.equals(account.address)) + 1}`;
return `Account`;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const WalletAuthAccounts = ({
})
.map((account, index) => {
const isActiveAccount = selectedAccount && selectedAccount.address.equals(account.address);
const accountLabel = accountLabels?.[account.address.toBase58()] || `Account ${index + 1}`;
const accountLabel = accountLabels?.[account.address.toBase58()] || `Account`;
return (
<Button
key={index}
Expand Down

0 comments on commit ee83c98

Please sign in to comment.