-
Notifications
You must be signed in to change notification settings - Fork 300
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
fix: fixed redirection back to dp2p #7609
Changes from 2 commits
947eda5
58b5008
b17d512
0274eb7
d4ce66e
4406c28
de0a0c9
7c5d279
e514998
2cd66a2
35c889d
6d8dc58
806b4f7
3043b04
4754102
83a1bf5
a4611a1
49b7cf9
1e9a998
0d6a836
e8bd136
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import React from 'react'; | ||
import { Button, Loading } from '@deriv/components'; | ||
import { getPlatformRedirect, WS } from '@deriv/shared'; | ||
import { getPlatformRedirect, platforms, WS } from '@deriv/shared'; | ||
import { Localize } from '@deriv/translations'; | ||
import { useHistory } from 'react-router'; | ||
import DemoMessage from 'Components/demo-message'; | ||
|
@@ -97,7 +97,18 @@ const ProofOfIdentityContainer = ({ | |
} | ||
|
||
const redirect_button = should_show_redirect_btn && ( | ||
<Button primary className='proof-of-identity__redirect' onClick={() => routeBackTo(from_platform.route)}> | ||
<Button | ||
primary | ||
className='proof-of-identity__redirect' | ||
onClick={() => { | ||
if (platforms[from_platform.name?.toLowerCase()].is_hard_redirect) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if platforms[from_platform.name] is null? add a guard for that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. best to assign
|
||
const url = platforms[from_platform.name?.toLowerCase()]?.url; | ||
window.location.href = url; | ||
} else { | ||
routeBackTo(from_platform.route); | ||
} | ||
}} | ||
> | ||
<Localize i18n_default_text='Back to {{platform_name}}' values={{ platform_name: from_platform.name }} /> | ||
</Button> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this function outside here?