Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
fix: Don't show ThirPartyApp message for the cookies warning flow (#3676
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yagopv authored Mar 15, 2022
1 parent 9b5f570 commit a6323ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { currentSafeWithNames } from 'src/logic/safe/store/selectors'
import { TransactionParams } from '../components/AppFrame'
import { SafeApp } from 'src/routes/safe/components/Apps/types'
import { getLegacyChainName } from '../utils'
import { THIRD_PARTY_COOKIES_CHECK_URL } from './useThirdPartyCookies'

type InterfaceMessageProps<T extends InterfaceMessageIds> = {
messageId: T
Expand Down Expand Up @@ -112,9 +113,10 @@ const useIframeMessageHandler = (
data: SDKMessageToPayload[SDKMessageIds]
}>,
) => {
if (message.origin === window.origin) {
if (message.origin === window.origin || message.origin === THIRD_PARTY_COOKIES_CHECK_URL) {
return
}

if (!selectedApp?.url.includes(message.origin)) {
console.error(`ThirdPartyApp: A message was received from an unknown origin ${message.origin}`)
return
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect, useRef, useCallback } from 'react'

const THIRD_PARTY_COOKIES_CHECK_URL = 'https://third-party-cookies-check.gnosis-safe.com'
export const THIRD_PARTY_COOKIES_CHECK_URL = 'https://third-party-cookies-check.gnosis-safe.com'
const SHOW_ALERT_TIMEOUT = 10000

const isSafari = (): boolean => {
Expand Down

0 comments on commit a6323ad

Please sign in to comment.