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:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user