Skip to content

Commit

Permalink
PR default off and unified parser
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 12, 2024
1 parent 8195e9b commit 9ee3f0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@
</q-list>
</div>

<div class="q-py-sm q-px-xs text-left" on-left>
<!-- payment requests -->
<!-- NOTE: temporarily disabled the button until fix -->
<div v-if="enablePaymentRequest" class="q-py-sm q-px-xs text-left" on-left>
<q-item class="q-pt-lg">
<q-item-section>
<q-item-label overline class="text-weight-bold"
Expand All @@ -228,7 +230,6 @@
>
</q-item-section>
</q-item>
<!-- use a q-toggle to turn nwc on and off -->
<q-item>
<q-toggle
v-model="enablePaymentRequest"
Expand Down
7 changes: 7 additions & 0 deletions src/stores/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1008,13 +1008,20 @@ export const useWalletStore = defineStore("wallet", {
},
decodeRequest: async function (req: string) {
const p2pkStore = useP2PKStore()
req = req.trim();
this.payInvoiceData.input.request = req
if (req.toLowerCase().startsWith("lnbc")) {
this.payInvoiceData.input.request = req;
await this.handleBolt11Invoice()
} else if (req.toLowerCase().startsWith("lightning:")) {
this.payInvoiceData.input.request = req.slice(10);
await this.handleBolt11Invoice()
} else if (req.startsWith("bitcoin:")) {
const lightningInvoice = req.match(/lightning=([^&]+)/);
if (lightningInvoice) {
this.payInvoiceData.input.request = lightningInvoice[1];
await this.handleBolt11Invoice();
}
} else if (req.toLowerCase().startsWith("lnurl:")) {
this.payInvoiceData.input.request = req.slice(6);
await this.lnurlPayFirst(this.payInvoiceData.input.request);
Expand Down

0 comments on commit 9ee3f0f

Please sign in to comment.