Skip to content

Conversation

vctt94
Copy link
Member

@vctt94 vctt94 commented Jun 2, 2022

this PR closes #1531

Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Working well.

@@ -319,8 +310,6 @@ export default class SettingsPage extends BasePage {
/* Called after successful registration to a DEX. */
async registerDEXSuccess () {
const page = this.page
page.dexAddr.value = ''
this.clearCertFile()
Copy link
Member

Choose a reason for hiding this comment

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

@martonp Would you comment on this? You added this in #1135

There's also a clearCertFile in forms.ts.

I'm not clear on the root cause of this bug or why the fix is appropriate. @vctt94 Can you comment on what you observed going wrong, and why we do not need to clear this?

Copy link
Collaborator

@martonp martonp Jun 9, 2022

Choose a reason for hiding this comment

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

In forms.tmpl, dexAddr used to be the id of the element, but it got updated to be a data-tmpl, so it wasn't getting loaded into the page object on the settings page.

As @vctt94 said, it probably happened during a refactoring to modals. This code that clears the form should be in the form's class, it shouldn't have been here in the first place.

@vctt94
Copy link
Member Author

vctt94 commented Jun 7, 2022

I believe the reason of the bug is the refactor which changed how forms were, to the newer version with modals. So when it gets to the point of register success, the page.addr component is already '' and it throws an error.

Right now the refresh() method on forms is taking care of removing the page.addr value, but it is not calling the clearCertFile() method, making the cert file keep its value, if closing the form.

I also added the clearCertFile() now on the refresh() method and should be working as expected, even though the password input still keep its value, should it also be cleaned?

@vctt94 vctt94 force-pushed the fix-add-new-dex-server branch from e71f558 to b91a36f Compare June 7, 2022 17:57
@chappjc chappjc added this to the 0.5 milestone Jun 9, 2022
Copy link
Collaborator

@martonp martonp left a comment

Choose a reason for hiding this comment

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

LGTM

@chappjc chappjc self-requested a review June 13, 2022 16:10
Copy link
Member

@chappjc chappjc left a comment

Choose a reason for hiding this comment

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

LGTM. A glance from @buck54321 and we can merged.

Copy link
Member

@buck54321 buck54321 left a comment

Choose a reason for hiding this comment

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

It looks like there's some related cleanup to be done.

In forms.tmpl, the elements are

<label for="dexAddr" class="form-label ps-1 mt-2">[[[DEX Address]]]</label>
<input type="text" class="form-control select" data-tmpl="addr">

But that for attribute no longer makes sense. We should add an id back to the input so that user clicks on the label will cause focus on the element.

Also, there are two page methods called getDexAddr that are unused. Could you nuke those too.

@chappjc chappjc merged commit 55b7a97 into decred:master Jun 20, 2022
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.

ui: js errors registering for second dex from settings page
5 participants