Skip to content

Commit

Permalink
Use createMatchSelector selector in Profile component (#1966)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbodnar committed Oct 19, 2021
1 parent a6e2707 commit 23cd6ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/frontend/src/components/profile/Profile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BN from 'bn.js';
import { createMatchSelector } from 'connected-react-router';
import { formatNearAmount } from 'near-api-js/lib/utils/format';
import React, { useEffect, useState } from 'react';
import { Translate } from 'react-localize-redux';
Expand Down Expand Up @@ -136,7 +137,7 @@ export function Profile({ match }) {
const ledgerKey = useSelector((state) => selectAccountLedgerKey(state));
const loginAccountId = useSelector((state) => selectAccountId(state));
const nearTokenFiatValueUSD = useSelector((state) => selectNearTokenFiatValueUSD(state));
const accountIdFromUrl = match.params.accountId;
const accountIdFromUrl = useSelector(createMatchSelector('/profile/:accountId'))?.params.accountId;
const accountId = accountIdFromUrl || loginAccountId;
const isOwner = accountId === loginAccountId;
const account = useAccount(accountId);
Expand Down

0 comments on commit 23cd6ea

Please sign in to comment.