-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Improve encrypt/decrypt flow #125
base: main
Are you sure you want to change the base?
Conversation
Made encrypt/decrypt a "fully functional" flow, so the test dapp can actually be used as an encrypted messenger. Fixes #124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This design looks good! This will almost certainly break the e2e tests, but we can fix those easily enough. We should publish this as a breaking change to indicate that.
I think the button disabled state logic needs some cleanup. For the two new inputs (public encryption key and encrypted message), we could add listeners to enable the associated button when they are non-empty.
@@ -258,12 +258,17 @@ <h4 class="card-title"> | |||
<button | |||
class="btn btn-primary btn-lg btn-block mb-3" | |||
id="getEncryptionKeyButton" | |||
disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed? The intention was to have all of the buttons that rely upon an account being connected to start as disabled until we know whether something is connected or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same goes for the "decrypt" button.
|
||
<button | ||
class="btn btn-primary btn-lg btn-block mb-3" | ||
id="encryptButton" | ||
disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, this one was meant to be disabled until we have a public encryption key to encrypt with.
@@ -6,6 +6,7 @@ import { | |||
recoverTypedSignatureLegacy, | |||
recoverTypedSignature, | |||
recoverTypedSignature_v4 as recoverTypedSignatureV4, | |||
decrypt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is causing the linter to fail
encryptMessageInput.value.length > 0 | ||
) { | ||
if (encryptButton.disabled) { | ||
encryptButton.disabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this deleted to allow encrypting an empty message? I'm not sure why that was disallowed to being with 🤔 Does that work?
Made encrypt/decrypt a "fully functional" flow, so the test dapp can
actually be used as an encrypted messenger.
Changes some element ordering, and the encryption is no longer assumed to the connected address, but requires input, so this could break an e2e test that relies on it.
Fixes #124
Looks like this: