Skip to content
Permalink
Browse files
fix connection on android
  • Loading branch information
tampham47 committed Aug 21, 2021
1 parent 47a3cbb commit 63f517408808dffecdd4196295e10fa7a52d99cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
@@ -1,6 +1,6 @@
{
"name": "@solareum/sol-wallet-adapter",
"version": "0.2.2",
"version": "0.2.4",
"description": "Library to allow Solana dApps to use third-party wallets to sign transactions",
"license": "Apache-2.0",
"repository": "solareum/sol-wallet-adapter",
@@ -70,8 +70,12 @@ export default class Wallet extends EventEmitter {
_handleConnect = () => {
if (!this._handlerAdded) {
this._handlerAdded = true;
window.addEventListener('message', this._handleMessage);
window.addEventListener('beforeunload', this.disconnect);
const isUIWebView = /\(ip.*applewebkit(?!.*(version|crios))/i.test(
navigator.userAgent,
);
const receiver = isUIWebView ? window : document;
receiver.addEventListener('message', this._handleMessage);
receiver.addEventListener('beforeunload', this.disconnect);
}
if (this._injectedProvider) {
return new Promise((resolve) => {

0 comments on commit 63f5174

Please sign in to comment.