Skip to content

Commit

Permalink
fix: Redirect to correct deeplink on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
mucahit committed Apr 22, 2022
1 parent 638f25e commit 621e947
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@perawallet/connect",
"version": "0.0.6",
"version": "0.0.7",
"description": "JavaScript SDK for integrating Pera Wallet to web applications.",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/modal/_pera-wallet-connect-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@
}

.pera-wallet-connect-modal__qr-code {
cursor: none;

text-align: center;
}

.pera-wallet-connect-modal__qr-code__text {
margin-bottom: 15px;
}
Expand Down
6 changes: 5 additions & 1 deletion src/util/peraWalletUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {detectBrowser} from "./device/deviceUtils";
import {detectBrowser, isAndroid} from "./device/deviceUtils";
import {PERA_WALLET_APP_DEEP_LINK} from "./peraWalletConstants";

/**
Expand All @@ -9,6 +9,10 @@ function generatePeraWalletDeeplink(uri: string): string {
let deeplink = `${PERA_WALLET_APP_DEEP_LINK}wc?uri=${encodeURIComponent(uri)}`;
const browserName = detectBrowser();

if (isAndroid()) {
deeplink = uri;
}

if (browserName) {
deeplink = `${deeplink}&browser=${browserName}`;
}
Expand Down

0 comments on commit 621e947

Please sign in to comment.