Skip to content

Commit

Permalink
Merge pull request #127 from shayan-deriv/shayan/feq-2377/disable-ifr…
Browse files Browse the repository at this point in the history
…ame-loading-in-p2p

shayan/fix: fixed multiple connection issue
  • Loading branch information
ali-hosseini-deriv authored Jun 13, 2024
2 parents 5aa9a81 + d8e6c18 commit 4fdc46a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions public/localstorage-sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
switch (message.data.key) {
case 'active_loginid': {
if (localStorage.getItem(message.data.key) !== message.data.value) {
console.log('setting p2p localStorage for active_loginid');
localStorage.setItem(message.data.key, message.data.value);
}
break;
}
case 'client.accounts': {
if (localStorage.getItem(message.data.key) !== message.data.value) {
console.log('setting p2p localStorage for client.accounts');
localStorage.setItem(message.data.key, message.data.value);
}
break;
Expand Down
6 changes: 4 additions & 2 deletions src/components/DerivIframe/DerivIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { URLConstants } from '@deriv-com/utils';

const DerivIframe = () => {
const getAllowedLocalStorageOrigin = () => {
if (/^staging-p2p\.deriv\.com$/i.test(window.location.hostname)) {
const hostName = window.location.hostname;
if (/^staging-p2p\.deriv\.com$/i.test(hostName)) {
return URLConstants.derivP2pStaging;
} else if (/^localhost$/i.test(hostName)) {
return window.location.origin;
}

return URLConstants.derivP2pProduction;
};

Expand Down

0 comments on commit 4fdc46a

Please sign in to comment.