Skip to content

src/components/Widget.ce.vue Payments note fix with Page Title fallback for TwentyOneUno Wordpress Widget #14

@satwise

Description

@satwise

This change fixes issues where raw LNURL metadata was appearing in the transaction Note, as well as not populating a Note when the user specifies one, so I have added a helper function getPaymentNote() that ensures:

  1. If the user types a note, that note is used.
  2. If the user does not type a note, the document title is used (removing the " - WordPress" suffix).
  3. The transaction note is always a clean string, preventing JSON objects from being passed to the wallet.

Image

Use this function inside payKeysend and payInvoice so alll notes will be passed clean, tag-free, and bracket-free:

getPaymentNote: function() { // 1. Priority: User's manual note if (this.comment && this.comment.trim() !== '') { return this.comment; } // 2. Fallback: Page Title // document.title is ALREADY plain text (no HTML tags). // We just remove the WordPress suffix to keep it short. return document.title ? document.title.replace(' - WordPress', '') : 'Zap'; },

New vue file candidate is attached

Widget.ce.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions