Skip to content

Commit

Permalink
Merge pull request #1635 from AmbireTech/gnosis-app-origin
Browse files Browse the repository at this point in the history
fix gnosis connector
  • Loading branch information
ivopaunov authored Aug 21, 2024
2 parents d6b7604 + b28f99e commit 66cb663
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/GnosisConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ function GnosisConnector(_iframeRef, _app) {

this.send = (data, requestId, error) => {
const sdkVersion = getSDKVersion()
const withOrigin = { ...data, origin: 'app.ambire.wallet' }
const msg = error
? MessageFormatter.makeErrorResponse(requestId, error, sdkVersion)
: MessageFormatter.makeResponse(requestId, withOrigin, sdkVersion)
: MessageFormatter.makeResponse(requestId, data, sdkVersion)

const withOrigin = { ...msg, origin: 'app.ambire.wallet' }

if (this.iframeRef) {
// console.log("Posting to child")
// console.log(msg)
this.iframeRef.current?.contentWindow?.postMessage(msg, '*')
this.iframeRef.current?.contentWindow?.postMessage(withOrigin, '*')
} else {
console.log('Iframe not referenced ')
}
Expand Down

0 comments on commit 66cb663

Please sign in to comment.