From fc8c4aaa4580f1b52f095a73a5afc95996588a0c Mon Sep 17 00:00:00 2001 From: 2ro <17595647+2ro@users.noreply.github.com> Date: Fri, 10 Jul 2026 13:41:43 -0400 Subject: [PATCH] Copy 24-word seed phrase via auto-clearing clipboard helper Both seed-copy buttons (wallet creation and onboarding) now use copy_secret_to_buffer, which compare-then-clears the clipboard after a delay, matching the nsec copy path, instead of the non-clearing copy_string_to_buffer. --- src/gui/views/goblin/onboarding.rs | 4 +++- src/gui/views/wallets/creation/content.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/views/goblin/onboarding.rs b/src/gui/views/goblin/onboarding.rs index 9e6a748c..8e3e9f49 100644 --- a/src/gui/views/goblin/onboarding.rs +++ b/src/gui/views/goblin/onboarding.rs @@ -666,7 +666,9 @@ impl OnboardingContent { t!("goblin.onboarding.words.copy_clipboard").to_string() }; if w::chip(ui, &label, false).clicked() { - cb.copy_string_to_buffer(self.mnemonic_setup.mnemonic.get_phrase()); + // Secret: auto-clears from the clipboard after a delay + // (compare-then-clear) so the seed phrase does not linger there. + cb.copy_secret_to_buffer(self.mnemonic_setup.mnemonic.get_phrase()); cb.vibrate_copy(); self.words_copied = Some(std::time::Instant::now()); } diff --git a/src/gui/views/wallets/creation/content.rs b/src/gui/views/wallets/creation/content.rs index 57d5d469..a18315c4 100644 --- a/src/gui/views/wallets/creation/content.rs +++ b/src/gui/views/wallets/creation/content.rs @@ -231,7 +231,10 @@ impl WalletCreationContent { PhraseMode::Generate => { let c_t = format!("{} {}", COPY, t!("copy")); View::button(ui, c_t, Colors::white_or_black(false), || { - cb.copy_string_to_buffer( + // Secret: auto-clears from the clipboard after a + // delay (compare-then-clear) so the seed phrase + // does not linger there, matching the nsec. + cb.copy_secret_to_buffer( self.mnemonic_setup.mnemonic.get_phrase(), ); });