Skip to content

Commit

Permalink
Fix dialog updates (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Nov 13, 2021
1 parent 43e13c9 commit a21933a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/dialogs/hacs-custom-repositories-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export class HacsCustomRepositoriesDialog extends HacsDialogBase {
changedProperties.has("active") ||
changedProperties.has("_error") ||
changedProperties.has("_addRepositoryData") ||
changedProperties.has("_progress") ||
changedProperties.has("repositories")
changedProperties.has("_progress")
);
}

Expand Down Expand Up @@ -155,6 +154,7 @@ export class HacsCustomRepositoriesDialog extends HacsDialogBase {
}

private async _removeRepository(repository: string) {
this._progress = true;
this._error = undefined;
await repositoryDelete(this.hass, repository);
const repositories = await getRepositories(this.hass);
Expand All @@ -165,6 +165,7 @@ export class HacsCustomRepositoriesDialog extends HacsDialogBase {
composed: true,
})
);
this._progress = false;
}

private async _showReopsitoryInfo(repository: string) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/dialogs/hacs-install-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class HacsInstallDialog extends HacsDialogBase {
composed: true,
})
);
this._repository = this._getRepository(repositories, this.repository!);
}
this._toggle = false;
this.hass.connection.subscribeEvents((msg) => (this._error = (msg as any).data), "hacs/error");
Expand Down Expand Up @@ -206,6 +207,7 @@ export class HacsInstallDialog extends HacsDialogBase {
composed: true,
})
);
this._repository = this._getRepository(repositories, this.repository!);
this._toggle = false;
}
this._downloadRepositoryData = ev.detail.value;
Expand Down
4 changes: 3 additions & 1 deletion src/components/dialogs/hacs-repository-info-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ export class HacsRepositoryDialog extends HacsDialogBase {
if (propName === "hass") {
this.sidebarDocked = window.localStorage.getItem("dockedSidebar") === '"docked"';
}
if (propName === "repositories") {
if (propName === "hacs") {
this._repository = this._getRepository(this.hacs.repositories, this.repository!);
}
});
console.log(changedProperties);
return (
changedProperties.has("sidebarDocked") ||
changedProperties.has("narrow") ||
Expand All @@ -68,6 +69,7 @@ export class HacsRepositoryDialog extends HacsDialogBase {
composed: true,
})
);
this._repository = this._getRepository(repositories, this.repository!);
}
}

Expand Down

0 comments on commit a21933a

Please sign in to comment.