Skip to content

Commit

Permalink
Remove number check on url param
Browse files Browse the repository at this point in the history
  • Loading branch information
OGPoyraz committed Sep 19, 2023
1 parent d099d5e commit a7ff201
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import {
unconfirmedTransactionsListSelector,
} from '../../selectors';
import ConfirmTransactionSwitch from './confirm-transaction-switch.component';
import { CONFIRM_TRANSACTION_ROUTE } from '../../helpers/constants/routes';

const mapStateToProps = (state, ownProps) => {
const unapprovedTxs = getUnapprovedTransactions(state);
const {
match: { params = {}, url },
} = ownProps;
const urlId = url?.match(/\d+/u) && url?.match(/\d+/u)[0];
const confirmTransactionRoute = `${CONFIRM_TRANSACTION_ROUTE}/`;
const urlId = url.includes(confirmTransactionRoute) ? url.split(confirmTransactionRoute)[1] : null;
const { id: paramsId } = params;
const transactionId = paramsId || urlId;

Expand Down

0 comments on commit a7ff201

Please sign in to comment.