feat: deeplinks support (#58)

* feat: deeplinks support

* fix: move href logic into compute

* chore: fix linting
This commit is contained in:
Tiago Vasconcelos 2025-06-16 14:17:08 +01:00 committed by GitHub
commit b86263cefa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 72 additions and 1 deletions

View file

@ -148,6 +148,15 @@ window.app = Vue.createApp({
}
}
},
computed: {
deeplinkUrl() {
const baseUrl = `boltcard://${this.qrCodeDialog.wipe ? 'reset' : 'program'}`
const url =
this.qrCodeDialog.data.link +
(this.qrCodeDialog.wipe ? '&wipe=true' : '')
return `${baseUrl}?url=${encodeURIComponent(url)}`
}
},
methods: {
readNfcTag() {
const ndef = new NDEFReader()
@ -229,6 +238,9 @@ window.app = Vue.createApp({
this.qrCodeDialog.data = {
id: card.id,
link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp,
encodedURI: encodeURIComponent(
window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp
),
name: card.card_name,
uid: card.uid,
external_id: card.external_id,