Skip to content

Commit 4fdc46a

Browse files
Merge pull request #127 from shayan-deriv/shayan/feq-2377/disable-iframe-loading-in-p2p
shayan/fix: fixed multiple connection issue
2 parents 5aa9a81 + d8e6c18 commit 4fdc46a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

public/localstorage-sync.html

+2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
switch (message.data.key) {
2424
case 'active_loginid': {
2525
if (localStorage.getItem(message.data.key) !== message.data.value) {
26+
console.log('setting p2p localStorage for active_loginid');
2627
localStorage.setItem(message.data.key, message.data.value);
2728
}
2829
break;
2930
}
3031
case 'client.accounts': {
3132
if (localStorage.getItem(message.data.key) !== message.data.value) {
33+
console.log('setting p2p localStorage for client.accounts');
3234
localStorage.setItem(message.data.key, message.data.value);
3335
}
3436
break;

src/components/DerivIframe/DerivIframe.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { URLConstants } from '@deriv-com/utils';
22

33
const DerivIframe = () => {
44
const getAllowedLocalStorageOrigin = () => {
5-
if (/^staging-p2p\.deriv\.com$/i.test(window.location.hostname)) {
5+
const hostName = window.location.hostname;
6+
if (/^staging-p2p\.deriv\.com$/i.test(hostName)) {
67
return URLConstants.derivP2pStaging;
8+
} else if (/^localhost$/i.test(hostName)) {
9+
return window.location.origin;
710
}
8-
911
return URLConstants.derivP2pProduction;
1012
};
1113

0 commit comments

Comments
 (0)