Skip to content

Commit

Permalink
refactor: use strict equals eth account
Browse files Browse the repository at this point in the history
  • Loading branch information
beths-ledger committed Feb 7, 2024
1 parent eb53310 commit 487845b
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
const { t } = useTranslation();
const dispatch = useDispatch();

const onClick = useCallback(() => {
const isEthereumAccount = account.type === "Account" && account.currency.id === "ethereum";

const onClickStake = useCallback(() => {
if (isAccountEmpty(account)) {
dispatch(
openModal("MODAL_NO_FUNDS_STAKE", {
Expand All @@ -32,16 +34,11 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
}
}, [account, dispatch, parentAccount]);

if (
account.type === "Account" &&
// Ethereum Classic is still on proof of work
account.currency.id !== "ethereum_classic" &&
account.currency.id.includes("ethereum")
) {
if (isEthereumAccount) {
return [
{
key: "Stake",
onClick,
onClick: onClickStake,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down

0 comments on commit 487845b

Please sign in to comment.