mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
On send/edit page, disable app header so that networks can't be changed (#14115)
* On send/edit page, disable app header so that networks can't be changed in the middle of a transaction. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Only disable header if we're in edit mode Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
This commit is contained in:
parent
172b9d51e6
commit
bc8d4a3a44
@ -69,6 +69,7 @@ import { getEnvironmentType } from '../../../app/scripts/lib/util';
|
|||||||
import ConfirmationPage from '../confirmation';
|
import ConfirmationPage from '../confirmation';
|
||||||
import OnboardingFlow from '../onboarding-flow/onboarding-flow';
|
import OnboardingFlow from '../onboarding-flow/onboarding-flow';
|
||||||
import QRHardwarePopover from '../../components/app/qr-hardware-popover';
|
import QRHardwarePopover from '../../components/app/qr-hardware-popover';
|
||||||
|
import { SEND_STAGES } from '../../ducks/send';
|
||||||
|
|
||||||
export default class Routes extends Component {
|
export default class Routes extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -95,6 +96,7 @@ export default class Routes extends Component {
|
|||||||
browserEnvironmentOs: PropTypes.string,
|
browserEnvironmentOs: PropTypes.string,
|
||||||
browserEnvironmentBrowser: PropTypes.string,
|
browserEnvironmentBrowser: PropTypes.string,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string,
|
||||||
|
sendStage: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
@ -242,6 +244,10 @@ export default class Routes extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onEditTransactionPage() {
|
||||||
|
return this.props.sendStage === SEND_STAGES.EDIT;
|
||||||
|
}
|
||||||
|
|
||||||
onSwapsPage() {
|
onSwapsPage() {
|
||||||
const { location } = this.props;
|
const { location } = this.props;
|
||||||
return Boolean(
|
return Boolean(
|
||||||
@ -359,6 +365,7 @@ export default class Routes extends Component {
|
|||||||
onClick={this.onAppHeaderClick}
|
onClick={this.onAppHeaderClick}
|
||||||
disabled={
|
disabled={
|
||||||
this.onConfirmPage() ||
|
this.onConfirmPage() ||
|
||||||
|
this.onEditTransactionPage() ||
|
||||||
(this.onSwapsPage() && !this.onSwapsBuildQuotePage())
|
(this.onSwapsPage() && !this.onSwapsBuildQuotePage())
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
} from '../../store/actions';
|
} from '../../store/actions';
|
||||||
import { pageChanged } from '../../ducks/history/history';
|
import { pageChanged } from '../../ducks/history/history';
|
||||||
import { prepareToLeaveSwaps } from '../../ducks/swaps/swaps';
|
import { prepareToLeaveSwaps } from '../../ducks/swaps/swaps';
|
||||||
|
import { getSendStage } from '../../ducks/send';
|
||||||
import Routes from './routes.component';
|
import Routes from './routes.component';
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
@ -38,6 +39,7 @@ function mapStateToProps(state) {
|
|||||||
providerId: getNetworkIdentifier(state),
|
providerId: getNetworkIdentifier(state),
|
||||||
providerType: state.metamask.provider?.type,
|
providerType: state.metamask.provider?.type,
|
||||||
theme: getTheme(state),
|
theme: getTheme(state),
|
||||||
|
sendStage: getSendStage(state),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user