Skip to content

Commit

Permalink
Fix Open with Wallet in PC
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorkostas committed Feb 18, 2025
1 parent 64ddab3 commit 8cbe15a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function transactionInit(transactionBody) {
}
}

function isMobileDevice() {
export function isMobileDevice() {
const userAgent = navigator.userAgent || navigator.vendor || window.opera;

// List of common mobile devices and user agents
Expand Down Expand Up @@ -152,8 +152,13 @@ export async function run(conf) {

const transaction = await transactionInit(config.request);
const uri = buildQRUri(transaction.client_id, transaction.request_uri);
if(isMobileDevice())
if(isMobileDevice()) {
sessionStorage.setItem("app_uri", uri);
} else {
document.getElementById("open-wallet-button").disabled = true;
document.getElementById("open-wallet-button").style.background = "#ccc";
}

paintQR(uri);

const pollingUrl = buildPollingUrl(transaction.transaction_id);
Expand Down Expand Up @@ -213,3 +218,4 @@ document.addEventListener("DOMContentLoaded", () => {
window.main = main;
window.run = run;
window.start = start;
window.isMobileDevice = isMobileDevice;

0 comments on commit 8cbe15a

Please sign in to comment.