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;