Skip to content

Commit

Permalink
Revert "Use createMatchSelector selector in RecoverWithLink component (
Browse files Browse the repository at this point in the history
…#1966)"

This reverts commit 884993c.
  • Loading branch information
marcinbodnar committed Oct 20, 2021
1 parent 807e14f commit 1ceb06c
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions packages/frontend/src/components/accounts/RecoverWithLink.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { createMatchSelector } from 'connected-react-router';
import React, { Component } from 'react';
import { Translate } from 'react-localize-redux';
import { connect } from 'react-redux';
Expand Down Expand Up @@ -168,7 +167,7 @@ class RecoverWithLink extends Component {
handleContinue = async () => {
await Mixpanel.withTracking("IE Recover with link",
async () => {
await this.props.recoverAccountSeedPhrase(this.state.seedPhrase, this.props.accountId, false);
await this.props.recoverAccountSeedPhrase(this.state.seedPhrase, this.props.match.params.accountId, false);
this.props.refreshAccount();
this.props.redirectTo('/');
this.props.clearAccountState();
Expand Down Expand Up @@ -246,16 +245,12 @@ const mapDispatchToProps = {
clearAccountState
};

const mapStateToProps = (state) => {
const matchSelector = createMatchSelector('/recover-with-link/:accountId/:seedPhrase');

return {
...selectAccountSlice(state),
accountId: matchSelector(state)?.params.accountId,
seedPhrase: matchSelector(state)?.params.seedPhrase,
mainLoader: selectStatusMainLoader(state)
};
};
const mapStateToProps = (state, { match }) => ({
...selectAccountSlice(state),
accountId: match.params.accountId,
seedPhrase: match.params.seedPhrase,
mainLoader: selectStatusMainLoader(state)
});

export const RecoverWithLinkWithRouter = connect(
mapStateToProps,
Expand Down

0 comments on commit 1ceb06c

Please sign in to comment.