From b4ff9a10a2b6e8118113ad864c9d66863eea6d9e Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 13 Oct 2026 16:00:10 -0500 Subject: [PATCH] fix(request): clear the stale payment URI, show it only for an address The request-payment dialog kept its generated payment URI across opens and closes. A dialog opened for an address with no payable shielded address could still show the previous request's URI, and the string lingered after the dialog closed. - The payment URI is cleared when the dialog opens, when it closes, and on the close cleanup path. - The URI field is shown only when there is both a URI and a real address to pay. Co-Authored-By: Claude Opus 4.8 --- src/ui/windows/request_payment_dialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/windows/request_payment_dialog.cpp b/src/ui/windows/request_payment_dialog.cpp index 9dcbaee..c21e301 100644 --- a/src/ui/windows/request_payment_dialog.cpp +++ b/src/ui/windows/request_payment_dialog.cpp @@ -46,6 +46,7 @@ void RequestPaymentDialog::show(const std::string& address) s_amount = 0.0; s_memo[0] = '\0'; s_label[0] = '\0'; + s_payment_uri.clear(); s_uri_dirty = true; // Only a shielded address can be paid (DragonX is a private chain): never prefill a mining address. @@ -66,6 +67,7 @@ void RequestPaymentDialog::show(const std::string& address) void RequestPaymentDialog::hide() { s_open = false; + s_payment_uri.clear(); if (s_qr_texture != 0) { FreeQRTexture(s_qr_texture); s_qr_texture = 0; @@ -184,7 +186,7 @@ void RequestPaymentDialog::render(App* app) ImGui::Spacing(); // Payment URI display - if (!s_payment_uri.empty()) { + if (!s_payment_uri.empty() && s_address[0] != '\0') { ImGui::Text("%s", TR("request_payment_uri")); // Bordered read-only field: bounds the raw drgx: URI within a box (it horizontal-scrolls if // long) rather than 4-char-chunking it like an address or letting a plain field overflow. @@ -249,6 +251,9 @@ void RequestPaymentDialog::render(App* app) } // Cleanup on close + if (!s_open) { + s_payment_uri.clear(); + } if (!s_open && s_qr_texture != 0) { FreeQRTexture(s_qr_texture); s_qr_texture = 0;