1
0
forked from GRIN/grim

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.
This commit is contained in:
2ro
2026-07-10 13:41:43 -04:00
parent 4baba58dc3
commit fc8c4aaa45
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -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());
}
+4 -1
View File
@@ -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(),
);
});