Receive screen: copy/share the npub, never a grin address
The right button copied the grin1 slatepack address and the left copied the nprofile — both wrong for 'how people pay me'. Now: left = Share a friendly 'Pay me on Goblin (goblin.st) — npub1…' message, right = Copy the bare npub. New receive.copy_npub / receive.share_message keys across all six locales.
This commit is contained in:
@@ -428,6 +428,8 @@ goblin:
|
||||
copied: "Kopiert"
|
||||
copy_nostr_id: "nostr-ID kopieren"
|
||||
copy_address: "Adresse kopieren"
|
||||
copy_npub: "npub kopieren"
|
||||
share_message: "Bezahl mich auf Goblin (goblin.st) — %{npub}"
|
||||
privacy_note: "Dein Benutzername ist öffentlich. Zahlungsinhalte bleiben im Netzwerk verschlüsselt."
|
||||
profile:
|
||||
title: "Profil"
|
||||
|
||||
@@ -428,6 +428,8 @@ goblin:
|
||||
copied: "Copied"
|
||||
copy_nostr_id: "Copy nostr ID"
|
||||
copy_address: "Copy address"
|
||||
copy_npub: "Copy npub"
|
||||
share_message: "Pay me on Goblin (goblin.st) — %{npub}"
|
||||
privacy_note: "Your username is public. Payment contents stay encrypted over the network."
|
||||
profile:
|
||||
title: "Profile"
|
||||
|
||||
@@ -428,6 +428,8 @@ goblin:
|
||||
copied: "Copié"
|
||||
copy_nostr_id: "Copier l'ID nostr"
|
||||
copy_address: "Copier l'adresse"
|
||||
copy_npub: "Copier npub"
|
||||
share_message: "Payez-moi sur Goblin (goblin.st) — %{npub}"
|
||||
privacy_note: "Votre nom d'utilisateur est public. Le contenu des paiements reste chiffré sur le réseau."
|
||||
profile:
|
||||
title: "Profil"
|
||||
|
||||
@@ -428,6 +428,8 @@ goblin:
|
||||
copied: "Скопировано"
|
||||
copy_nostr_id: "Копировать nostr ID"
|
||||
copy_address: "Копировать адрес"
|
||||
copy_npub: "Копировать npub"
|
||||
share_message: "Заплатите мне в Goblin (goblin.st) — %{npub}"
|
||||
privacy_note: "Ваше имя публично. Содержимое платежей остаётся зашифрованным в сети."
|
||||
profile:
|
||||
title: "Профиль"
|
||||
|
||||
@@ -428,6 +428,8 @@ goblin:
|
||||
copied: "Kopyalandı"
|
||||
copy_nostr_id: "nostr kimliğini kopyala"
|
||||
copy_address: "Adresi kopyala"
|
||||
copy_npub: "npub kopyala"
|
||||
share_message: "Goblin'de bana öde (goblin.st) — %{npub}"
|
||||
privacy_note: "Kullanıcı adın herkese açıktır. Ödeme içeriği ağ üzerinde şifreli kalır."
|
||||
profile:
|
||||
title: "Profil"
|
||||
|
||||
@@ -428,6 +428,8 @@ goblin:
|
||||
copied: "已复制"
|
||||
copy_nostr_id: "复制 nostr ID"
|
||||
copy_address: "复制地址"
|
||||
copy_npub: "复制 npub"
|
||||
share_message: "在 Goblin 上向我付款 (goblin.st) — %{npub}"
|
||||
privacy_note: "你的用户名是公开的。付款内容在网络中保持加密。"
|
||||
profile:
|
||||
title: "资料"
|
||||
|
||||
+17
-26
@@ -25,7 +25,7 @@ use eframe::epaint::{CornerRadius, FontId, Stroke};
|
||||
use egui::{Align, Color32, Layout, Margin, RichText, ScrollArea, Sense, Vec2};
|
||||
|
||||
use crate::gui::icons::{
|
||||
ARROW_DOWN, ARROW_LEFT, CHECK, CLOCK, COPY, PROHIBIT, QR_CODE, USER_CIRCLE, WALLET,
|
||||
ARROW_DOWN, ARROW_LEFT, CHECK, CLOCK, COPY, PROHIBIT, QR_CODE, SHARE, USER_CIRCLE, WALLET,
|
||||
};
|
||||
use crate::gui::platform::PlatformCallbacks;
|
||||
use crate::gui::theme::{self, fonts};
|
||||
@@ -1885,57 +1885,48 @@ impl GoblinWalletView {
|
||||
});
|
||||
|
||||
ui.add_space(12.0);
|
||||
// Transient per-button "Copied" feedback; silent copies read as dead
|
||||
// buttons.
|
||||
// Transient "Copied" feedback on the copy button; a silent copy reads as
|
||||
// a dead button.
|
||||
let fresh = |at: std::time::Instant| at.elapsed().as_millis() < 1500;
|
||||
let copied0 = matches!(self.receive_copied, Some((0, at)) if fresh(at));
|
||||
let copied1 = matches!(self.receive_copied, Some((1, at)) if fresh(at));
|
||||
let copied = matches!(self.receive_copied, Some((1, at)) if fresh(at));
|
||||
if self.receive_copied.is_some() {
|
||||
ui.ctx()
|
||||
.request_repaint_after(std::time::Duration::from_millis(200));
|
||||
}
|
||||
ui.horizontal(|ui| {
|
||||
let half = (ui.available_width() - 10.0) / 2.0;
|
||||
// Share a friendly "pay me" message carrying the bare npub — the
|
||||
// public key people pay you on. Never the nprofile or a grin address.
|
||||
ui.scope_builder(
|
||||
egui::UiBuilder::new().max_rect(egui::Rect::from_min_size(
|
||||
ui.cursor().min,
|
||||
Vec2::new(half, 56.0),
|
||||
)),
|
||||
|ui| {
|
||||
let label = if copied0 {
|
||||
format!("{} {}", CHECK, t!("goblin.receive.copied"))
|
||||
} else {
|
||||
format!("{} {}", COPY, t!("goblin.receive.copy_nostr_id"))
|
||||
};
|
||||
if w::big_action(ui, &label, true).clicked() {
|
||||
let copy = if nprofile.is_empty() {
|
||||
handle.clone()
|
||||
} else {
|
||||
nprofile.clone()
|
||||
};
|
||||
cb.copy_string_to_buffer(copy);
|
||||
self.receive_copied = Some((0, std::time::Instant::now()));
|
||||
let label = t!("goblin.send.share_btn", "icon" => SHARE);
|
||||
if w::big_action(ui, &label, true).clicked() && !npub.is_empty() {
|
||||
cb.share_text(
|
||||
t!("goblin.receive.share_message", "npub" => npub.clone()).to_string(),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
ui.add_space(10.0);
|
||||
// Copy the bare npub itself.
|
||||
ui.scope_builder(
|
||||
egui::UiBuilder::new().max_rect(egui::Rect::from_min_size(
|
||||
ui.cursor().min,
|
||||
Vec2::new(half, 56.0),
|
||||
)),
|
||||
|ui| {
|
||||
// Copy the grin1 slatepack address for manual exchange.
|
||||
let label = if copied1 {
|
||||
let label = if copied {
|
||||
format!("{} {}", CHECK, t!("goblin.receive.copied"))
|
||||
} else {
|
||||
t!("goblin.receive.copy_address").to_string()
|
||||
format!("{} {}", COPY, t!("goblin.receive.copy_npub"))
|
||||
};
|
||||
if w::big_action(ui, &label, false).clicked() {
|
||||
if let Some(addr) = wallet.slatepack_address() {
|
||||
cb.copy_string_to_buffer(addr);
|
||||
self.receive_copied = Some((1, std::time::Instant::now()));
|
||||
}
|
||||
if w::big_action(ui, &label, false).clicked() && !npub.is_empty() {
|
||||
cb.copy_string_to_buffer(npub.clone());
|
||||
self.receive_copied = Some((1, std::time::Instant::now()));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user