Skip to content

Commit

Permalink
Reset the contact view when a user clicks the "back" button.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Oct 2, 2023
1 parent 281ba14 commit 4d661ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/www/ui_components/app-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,11 @@ export class AppRoot extends mixinBehaviors([AppLocalizeBehavior], PolymerElemen
}

_goBack() {
if (this.page == 'contact') {
// TODO: Replace with `this.$.contactView` once the element is no longer inside a `dom-if`.
this.shadowRoot.querySelector('#contactView').reset();
}

// If there is a navigation on the webview's history stack, pop it off to go back.
if (history.length > 1) {
history.back();
Expand Down
2 changes: 1 addition & 1 deletion src/www/views/contact_view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class ContactView extends LitElement {
this.step = Step.FORM;
}

private reset() {
reset() {
this.isFormSubmitting = false;
this.showIssueSelector = false;
this.step = Step.ISSUE_WIZARD;
Expand Down

0 comments on commit 4d661ab

Please sign in to comment.