Skip to content

Commit

Permalink
refresh password reset form before display
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
  • Loading branch information
ukane-philemon committed Sep 10, 2024
1 parent f21fb92 commit cf703b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 1 addition & 4 deletions client/webserver/site/src/js/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1959,10 +1959,7 @@ export class AppPassResetForm {

constructor (form: PageElement, success: () => void) {
this.form = form
this.success = () => {
success()
this.refresh()
}
this.success = success
const page = this.page = Doc.idDescendants(form)
bind(form, page.resetAppPWSubmitBtn, () => this.resetAppPW())
}
Expand Down
5 changes: 4 additions & 1 deletion client/webserver/site/src/js/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export default class LoginPage extends BasePage {
prepAndDisplayLoginForm()

this.appPassResetForm = new AppPassResetForm(page.resetAppPWForm, () => { prepAndDisplayLoginForm() })
Doc.bind(page.forgotPassBtn, 'click', () => slideSwap(page.loginForm, page.resetAppPWForm))
Doc.bind(page.forgotPassBtn, 'click', () => {
this.appPassResetForm.refresh()
slideSwap(page.loginForm, page.resetAppPWForm)
})
Doc.bind(page.resetPassFormCloser, 'click', () => { prepAndDisplayLoginForm() })
Doc.bind(page.forms, 'mousedown', (e: MouseEvent) => {
if (!Doc.mouseInElement(e, page.resetAppPWForm) && Doc.isDisplayed(page.resetAppPWForm)) { prepAndDisplayLoginForm() }
Expand Down

0 comments on commit cf703b1

Please sign in to comment.