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

feat: trigger qrsigning modal using approval controller #6212

Merged
19 changes: 13 additions & 6 deletions app/components/Nav/Main/RootRPCMethodsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,16 @@ const RootRPCMethodsUI = (props) => {

const renderQRSigningModal = () => {
const { isSigningQRObject, QRState } = props;
const shouldRenderThisModal = !showPendingApproval && isSigningQRObject;
return (
shouldRenderThisModal && (
<QRSigningModal isVisible={isSigningQRObject} QRState={QRState} />
)
);

if (
!isSigningQRObject ||
transactionModalType ||
showPendingApproval?.type !== ApprovalTypes.TRANSACTION
) {
return null;
}

return <QRSigningModal isVisible QRState={QRState} />;
};

const onWalletConnectSessionApproval = () => {
Expand Down Expand Up @@ -439,6 +443,7 @@ const RootRPCMethodsUI = (props) => {

const hideTransactionModal = () => {
setShowPendingApproval(false);
setTransactionModalType(undefined);
matthewwalsh0 marked this conversation as resolved.
Show resolved Hide resolved
};

const showTransactionApproval = () =>
Expand Down Expand Up @@ -830,7 +835,9 @@ RootRPCMethodsUI.propTypes = {
* Chain id
*/
chainId: PropTypes.string,
// eslint-disable-next-line react/no-unused-prop-types
isSigningQRObject: PropTypes.bool,
// eslint-disable-next-line react/no-unused-prop-types
QRState: PropTypes.object,
/**
* updates redux when network is switched
Expand Down