Skip to content

Commit

Permalink
HOT FIX - content script wallet connect issue
Browse files Browse the repository at this point in the history
Closes #280
  • Loading branch information
tombeckenham committed Dec 12, 2024
1 parent bc07914 commit 23bf699
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flow-reference-wallet",
"version": "2.6.2",
"version": "2.6.3",
"description": "Digital wallet created for everyone.",
"scripts": {
"prepare:dev": "node ./build/prepareManifest.js dev",
Expand Down Expand Up @@ -224,5 +224,6 @@
"node-linker": "hoisted",
"strict-peer-dependencies": false,
"auto-install-peers": true
}
},
"packageManager": "[email protected]+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c"
}
15 changes: 13 additions & 2 deletions src/content-script/script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
import { WalletUtils } from '@onflow/fcl';
//import { WalletUtils } from '@onflow/fcl';
// import { nanoid } from 'nanoid';

// const channelName = nanoid();
Expand Down Expand Up @@ -32,4 +32,15 @@ const service = {
},
};

WalletUtils.injectExtService(service);
function injectExtService(service) {
if (service.type === 'authn' && service.endpoint !== null) {
if (!Array.isArray(window.fcl_extensions)) {
window.fcl_extensions = [];
}
window.fcl_extensions.push(service);
} else {
console.warn('Authn service is required');
}
}

injectExtService(service);

0 comments on commit 23bf699

Please sign in to comment.