Skip to content

Commit 3f4fc64

Browse files
committed
remove unnecessary check
1 parent 437d6d0 commit 3f4fc64

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

main/api/accounts/handleGetAccounts.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ export async function handleGetAccounts() {
1313
// Find and rename unnamed accounts
1414
const unnamedAccounts = fullAccounts.filter((account) => !account.name);
1515

16-
if (unnamedAccounts.length > 0) {
17-
// Try to rename each unnamed account
18-
for (const account of unnamedAccounts) {
19-
try {
20-
// Use last 4 characters of the address
21-
const newName = `unnamed-account-${account.address.slice(-4)}`;
16+
// Try to rename each unnamed account
17+
for (const account of unnamedAccounts) {
18+
try {
19+
// Use last 4 characters of the address
20+
const newName = `unnamed-account-${account.address.slice(-4)}`;
2221

23-
await rpcClient.wallet.renameAccount({
24-
account: "",
25-
newName,
26-
});
27-
// Update the account name in our local array
28-
account.name = newName;
29-
} catch (error) {
30-
console.error(`Failed to rename account ${account.address}:`, error);
31-
}
22+
await rpcClient.wallet.renameAccount({
23+
account: "",
24+
newName,
25+
});
26+
// Update the account name in our local array
27+
account.name = newName;
28+
} catch (error) {
29+
console.error(`Failed to rename account ${account.address}:`, error);
3230
}
3331
}
3432

0 commit comments

Comments
 (0)