Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/protect wallet modal receive request #1788

Merged
merged 6 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Current Develop Branch

## v1.0.0
- [#1788](https://github.com/MetaMask/metamask-mobile/pull/1788): bugfix/protect wallet modal receive request (#1788)
- [#1666](https://github.com/MetaMask/metamask-mobile/pull/1666): Fiat on Ramp: Payments (#1666)
- [#1783](https://github.com/MetaMask/metamask-mobile/pull/1783): bugfix/hide protect wallet modal (#1783)
- [#1779](https://github.com/MetaMask/metamask-mobile/pull/1779): Update camera lib (#1779)
Expand Down
25 changes: 16 additions & 9 deletions app/components/UI/ReceiveRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ class ReceiveRequest extends PureComponent {
/**
* Hides the modal that contains the component
*/
hideModal: PropTypes.func
hideModal: PropTypes.func,
/**
* redux flag that indicates if the user
* completed the seed phrase backup flow
*/
seedphraseBackedUp: PropTypes.bool
};

state = {
Expand Down Expand Up @@ -182,17 +187,18 @@ class ReceiveRequest extends PureComponent {
content: 'clipboard-alert',
data: { msg: strings('account_details.account_copied_to_clipboard') }
});
setTimeout(() => this.props.protectWalletModalVisible(), 1500);
if (!this.props.seedphraseBackedUp) {
setTimeout(() => this.props.hideModal(), 1000);
setTimeout(() => this.props.protectWalletModalVisible(), 1500);
}
};

/**
* Closes QR code modal
*/
closeQrModal = () => {
this.setState({ qrModalVisible: false }, () => {
this.props.hideModal();
setTimeout(() => this.props.protectWalletModalVisible(), 1000);
});
closeQrModal = toggleModal => {
this.props.hideModal();
toggleModal();
};

/**
Expand Down Expand Up @@ -252,7 +258,7 @@ class ReceiveRequest extends PureComponent {
propagateSwipe
testID={'qr-modal'}
>
<AddressQRCode closeQrModal={toggleModal} />
<AddressQRCode closeQrModal={() => this.closeQrModal(toggleModal)} />
</Modal>
</>
)}
Expand Down Expand Up @@ -296,7 +302,8 @@ class ReceiveRequest extends PureComponent {
const mapStateToProps = state => ({
network: state.engine.backgroundState.NetworkController.network,
selectedAddress: state.engine.backgroundState.PreferencesController.selectedAddress,
receiveAsset: state.modals.receiveAsset
receiveAsset: state.modals.receiveAsset,
seedphraseBackedUp: state.user.seedphraseBackedUp
});

const mapDispatchToProps = dispatch => ({
Expand Down
3 changes: 3 additions & 0 deletions app/components/UI/ReceiveRequest/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ describe('ReceiveRequest', () => {
},
modals: {
receiveAsset: {}
},
user: {
seedphraseBackedUp: true
}
};

Expand Down
12 changes: 9 additions & 3 deletions app/components/Views/AddressQRCode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,20 @@ class AddressQRCode extends PureComponent {
/**
* Prompts protect wallet modal
*/
protectWalletModalVisible: PropTypes.func
protectWalletModalVisible: PropTypes.func,
/**
* redux flag that indicates if the user
* completed the seed phrase backup flow
*/
seedphraseBackedUp: PropTypes.bool
};

/**
* Closes QR code modal
*/
closeQrModal = () => {
this.props.closeQrModal();
setTimeout(() => this.props.protectWalletModalVisible(), 1000);
!this.props.seedphraseBackedUp && setTimeout(() => this.props.protectWalletModalVisible(), 1000);
};

copyAccountToClipboard = async () => {
Expand Down Expand Up @@ -141,7 +146,8 @@ class AddressQRCode extends PureComponent {
}

const mapStateToProps = state => ({
selectedAddress: state.engine.backgroundState.PreferencesController.selectedAddress
selectedAddress: state.engine.backgroundState.PreferencesController.selectedAddress,
seedphraseBackedUp: state.user.seedphraseBackedUp
});

const mapDispatchToProps = dispatch => ({
Expand Down
4 changes: 2 additions & 2 deletions ios/MetaMask.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 519;
CURRENT_PROJECT_VERSION = 520;
DEAD_CODE_STRIPPING = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
Expand Down Expand Up @@ -910,7 +910,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 519;
CURRENT_PROJECT_VERSION = 520;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
FRAMEWORK_SEARCH_PATHS = (
Expand Down