Skip to content

Close new automation dialog before moving to next step#9071

Merged
bramkragten merged 3 commits intodevfrom
new-automation-close-before-move-on
May 8, 2021
Merged

Close new automation dialog before moving to next step#9071
bramkragten merged 3 commits intodevfrom
new-automation-close-before-move-on

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented May 2, 2021

Breaking change

Proposed change

There was a race condition that prevented the new automation dialog from being cleaned up from the history. This caused users to get stuck because pressing the back arrow on the new automation would send you back to the dialog, which you can't close on mobile.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

}

public closeDialog(): void {
public async closeDialog(): Promise<void> {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bramkragten is this a standardized method?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use implements HassDialog and you'll get an error now :-)


public closeDialog(): void {
public async closeDialog(): Promise<void> {
if (!this._opened) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Without this guard, it would fire twice because of the @closed event listener on <ha-dialog>

@bramkragten bramkragten merged commit 7f49f03 into dev May 8, 2021
@bramkragten bramkragten deleted the new-automation-close-before-move-on branch May 8, 2021 11:53
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants