Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clear words in RestoreKey #1515

Conversation

icoxxx
Copy link
Contributor

@icoxxx icoxxx commented Feb 4, 2025

Description:
Simple fix of clear words handler in RestoreKey. (watcher in child component wasn't detecting the changes on clicking of the 'clear' button).

Related issue(s):
#1375

@icoxxx icoxxx self-assigned this Feb 4, 2025
@icoxxx icoxxx requested review from SvetBorislavov, yiliev0 and a team as code owners February 4, 2025 08:08
@icoxxx icoxxx requested a review from SimiHunjan February 4, 2025 08:08
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.07%. Comparing base (9050df9) to head (c14ccd9).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1515   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files         159      159           
  Lines        5950     5950           
  Branches     1084     1090    +6     
=======================================
  Hits         5895     5895           
+ Misses         55       52    -3     
- Partials        0        3    +3     

see 3 files with indirect coverage changes

Impacted file tree graph

Copy link
Contributor

@SvetBorislavov SvetBorislavov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is not applied everywhere.
To apply it, change the setter function the userStore to this:

  const setRecoveryPhrase = async (words: string[] | null) => {
    if (words === null) {
      recoveryPhrase.value = { words: [], hash: '' } as unknown as RecoveryPhrase;
      await nextTick();
      recoveryPhrase.value = null;
    } else {
      recoveryPhrase.value = await ush.createRecoveryPhrase(words);
    }
  };

and find everywhere in the app the direct assignments of the recovery phrase and replace them with the setter function

@icoxxx icoxxx force-pushed the 1375-clear-button-does-not-clear-manually-typed-words-in-recovery-phrase-input-fields branch from 481408e to 8ef0cf1 Compare February 6, 2025 14:40
@icoxxx icoxxx force-pushed the 1375-clear-button-does-not-clear-manually-typed-words-in-recovery-phrase-input-fields branch from e668453 to 62f9a08 Compare February 7, 2025 19:45
@icoxxx icoxxx force-pushed the 1375-clear-button-does-not-clear-manually-typed-words-in-recovery-phrase-input-fields branch from 62f9a08 to 475f282 Compare February 10, 2025 09:52
yiliev0
yiliev0 previously approved these changes Feb 10, 2025
Copy link
Contributor

@yiliev0 yiliev0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested.

@jbair06
Copy link
Member

jbair06 commented Feb 11, 2025

@yiliev0 We may need to adjust the tests to catch for the issue I described in my review.

Signed-off-by: Hristiyan <[email protected]>
Signed-off-by: Hristiyan <[email protected]>
@icoxxx icoxxx force-pushed the 1375-clear-button-does-not-clear-manually-typed-words-in-recovery-phrase-input-fields branch from aaa5d8f to 74c40e1 Compare February 11, 2025 09:41
@icoxxx icoxxx requested review from jbair06 and yiliev0 February 11, 2025 09:41
yiliev0 and others added 5 commits February 11, 2025 14:49
Signed-off-by: Hristiyan <[email protected]>
Signed-off-by: Hristiyan <[email protected]>
Signed-off-by: Yordan Iliev <[email protected]>
Signed-off-by: Yordan Iliev <[email protected]>
@jbair06 jbair06 merged commit a5dcdd6 into main Feb 11, 2025
17 checks passed
@jbair06 jbair06 deleted the 1375-clear-button-does-not-clear-manually-typed-words-in-recovery-phrase-input-fields branch February 11, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clear button does not clear manually typed words in Recovery Phrase input fields
4 participants