Skip to content

Commit

Permalink
add token to hashtag instead of URL param
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 6, 2024
1 parent aaea47f commit 6c936f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = configure(function (/* ctx */) {
node: "node16",
},

vueRouterMode: "hash", // available values: 'hash', 'history'
vueRouterMode: "history", // available values: 'hash', 'history'
// vueRouterBase,
// vueDevtools,
// vueOptionsAPI: false,
Expand Down
2 changes: 1 addition & 1 deletion src/components/SendTokenDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
size="md"
icon="link"
flat
@click="copyText(baseURL + '?token=' + sendData.tokensBase64)"
@click="copyText(baseURL + '#token=' + sendData.tokensBase64)"
><q-tooltip>Copy link</q-tooltip></q-btn
>
<q-btn
Expand Down
7 changes: 4 additions & 3 deletions src/pages/WalletPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ export default {
this.registerBroadcastChannel();
let params = new URL(document.location).searchParams;
let hash = new URL(document.location).hash;
// mint url
if (params.get("mint")) {
Expand All @@ -597,8 +598,8 @@ export default {
console.log("Wallet URL " + this.baseURL);
// get token to receive tokens from a link
if (params.get("token")) {
let tokenBase64 = params.get("token");
if (params.get("token") || hash.includes("token")) {
let tokenBase64 = params.get("token") || hash.split("token=")[1];
// make sure to react only to tokens not in the users history
let seen = false;
for (var i = 0; i < this.historyTokens.length; i++) {
Expand All @@ -609,7 +610,7 @@ export default {
}
if (!seen) {
// show receive token dialog
this.receiveData.tokensBase64 = params.get("token");
this.receiveData.tokensBase64 = tokenBase64;
this.showReceiveTokens = true;
}
}
Expand Down

0 comments on commit 6c936f9

Please sign in to comment.