From e4b2c0cbba66dac75293c5d7552f21201a71a03a Mon Sep 17 00:00:00 2001
From: nada-deriv <122768621+nada-deriv@users.noreply.github.com>
Date: Tue, 30 May 2023 19:55:57 +0400
Subject: [PATCH] fix: fixed redirection back to dp2p (#7609)
* fix: fixed redirection back to dp2p
* fix: pr comment resolved
* fix: show button for idv poi submission
* fix: pr comment fix
* fix: pr comment fix
* fix: added destructuring default value
* fix: style fix
* fix: moved inline function outside
* fix: style fix for redirect button in idv submit
* fix: check for p2p using platform param
* fix: removed unused function
* fix: changed param checking from p2p to dp2p
* fix: persist local storage value until cleared
---
.../idv-submit-complete.tsx | 4 +--
.../proof-of-address-container.jsx | 1 +
.../proof-of-identity-container.jsx | 29 +++++++++----------
packages/account/src/Styles/account.scss | 14 ++++++++-
packages/core/src/Stores/common-store.js | 7 +++--
.../components/verification/verification.jsx | 10 ++++++-
.../shared/src/utils/platform/platform.ts | 11 ++-----
7 files changed, 47 insertions(+), 29 deletions(-)
diff --git a/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.tsx b/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.tsx
index df4fc25a1a2c..0b99c7bc0ef3 100644
--- a/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.tsx
+++ b/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.tsx
@@ -7,7 +7,7 @@ import { localize } from '@deriv/translations';
type TIdvSubmitComplete = {
needs_poa: boolean;
is_from_external: boolean;
- redirect_button: React.ReactNode;
+ redirect_button: React.ReactElement;
};
const IdvSubmitComplete = ({ needs_poa, is_from_external, redirect_button }: TIdvSubmitComplete) => {
@@ -30,7 +30,7 @@ const IdvSubmitComplete = ({ needs_poa, is_from_external, redirect_button }: TId
{poa_button}
) : (
- redirect_button
+
{redirect_button}
)}
);
diff --git a/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.jsx b/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.jsx
index e058445d07d0..0409590607f8 100644
--- a/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.jsx
+++ b/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.jsx
@@ -104,6 +104,7 @@ const ProofOfAddressContainer = ({
onClick={() => {
const url = platforms[from_platform.ref]?.url;
window.location.href = url;
+ window.localStorage.removeItem('config.platform');
}}
>
diff --git a/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container.jsx b/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container.jsx
index 435f9fbdee47..257e8b4ab2a8 100644
--- a/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container.jsx
+++ b/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container.jsx
@@ -1,7 +1,6 @@
import { Button, Loading } from '@deriv/components';
import { WS, getPlatformRedirect, platforms } from '@deriv/shared';
import { identity_status_codes, service_code } from './proof-of-identity-utils';
-
import DemoMessage from 'Components/demo-message';
import ErrorMessage from 'Components/error-component';
import Expired from 'Components/poi/status/expired';
@@ -98,22 +97,22 @@ const ProofOfIdentityContainer = ({
return ;
}
- const redirect_button = should_show_redirect_btn ? (
-