Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BW hotfix 2.0.2 #600

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/browser-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.0.2

### Fixed

- Fixed credentials with address undefined

## 2.0.1

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@concordium/browser-wallet",
"private": true,
"version": "2.0.1",
"version": "2.0.2",
"description": "Browser extension wallet for the Concordium blockchain",
"author": "Concordium Software",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function compareAsc(left: WalletCredential, right: WalletCredential): number {
if (right.credName === '' && left.credName !== '') {
return -1;
}
return left.credName.localeCompare(right.credName) || left.address.localeCompare(right.address);
return left.credName?.localeCompare(right.credName) || left.address?.localeCompare(right.address);
}

function compareDesc(left: WalletCredential, right: WalletCredential): number {
Expand Down Expand Up @@ -83,11 +83,13 @@ export default function AccountSelector({ showAccountSelector, onUpdateSelectedA
const credentials = credentialsLoading.value ?? [];
const filtered = useMemo(
() =>
credentials.filter(
(credential) =>
credential.credName?.toLowerCase().includes(search.toLowerCase()) ||
credential.address?.toLowerCase().includes(search.toLowerCase())
),
credentials
.filter((c) => c.address)
.filter(
(credential) =>
credential.credName?.toLowerCase().includes(search.toLowerCase()) ||
credential.address?.toLowerCase().includes(search.toLowerCase())
),
[search, credentials]
);
const sorted = useMemo(() => filtered.sort(ascSort ? compareAsc : compareDesc), [filtered, ascSort]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function compareAsc(left: WalletCredential, right: WalletCredential): number {
if (right.credName === '' && left.credName !== '') {
return -1;
}
return left.credName.localeCompare(right.credName) || left.address.localeCompare(right.address);
return left.credName?.localeCompare(right.credName) || left.address?.localeCompare(right.address);
}

function compareDesc(left: WalletCredential, right: WalletCredential): number {
Expand Down Expand Up @@ -129,7 +129,10 @@ export default function Accounts() {
const accounts = useAtomValue(credentialsAtom);
const nav = useNavigate();
const navToCreateAccount = useCallback(() => nav(absoluteRoutes.settings.createAccount.path), []);
const sorted = useMemo(() => accounts.sort(ascSort ? compareAsc : compareDesc), [accounts, ascSort]);
const sorted = useMemo(
() => accounts.filter((c) => c.address).sort(ascSort ? compareAsc : compareDesc),
[accounts, ascSort]
);

return (
<Page className="accounts-x">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function compareAsc(left: WalletCredential, right: WalletCredential): number {
if (right.credName === '' && left.credName !== '') {
return -1;
}
return left.credName.localeCompare(right.credName) || left.address.localeCompare(right.address);
return left.credName?.localeCompare(right.credName) || left.address?.localeCompare(right.address);
}

function compareDesc(left: WalletCredential, right: WalletCredential): number {
Expand Down Expand Up @@ -102,11 +102,13 @@ export default function ConnectAccount({ onAllow, onReject }: Props) {
const credentials = credentialsLoading.value ?? [];
const filtered = useMemo(
() =>
credentials.filter(
(credential) =>
credential.credName?.toLowerCase().includes(search.toLowerCase()) ||
credential.address?.toLowerCase().includes(search.toLowerCase())
),
credentials
.filter((c) => c.address)
.filter(
(credential) =>
credential.credName?.toLowerCase().includes(search.toLowerCase()) ||
credential.address?.toLowerCase().includes(search.toLowerCase())
),
[search, credentials]
);
const sorted = useMemo(() => filtered.sort(ascSort ? compareAsc : compareDesc), [filtered, ascSort]);
Expand Down
Loading