Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant-frontend
19 changes: 16 additions & 3 deletions src/dashboards/hacs-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
mdiInformation,
mdiNewBox,
} from "@mdi/js";
import type { CSSResultGroup, TemplateResult } from "lit";
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
import { LitElement, html, nothing } from "lit";
import { customElement, property, query, state } from "lit/decorators";
import memoize from "memoize-one";
Expand Down Expand Up @@ -39,7 +39,11 @@ import "../../homeassistant-frontend/src/components/ha-svg-icon";
import { PageNavigation } from "../../homeassistant-frontend/src/layouts/hass-tabs-subpage";
import { haStyle } from "../../homeassistant-frontend/src/resources/styles";
import type { HomeAssistant, Route } from "../../homeassistant-frontend/src/types";
import { brandsUrl } from "../../homeassistant-frontend/src/util/brands-url";
import {
brandsUrl,
clearBrandsTokenRefresh,
fetchAndScheduleBrandsAccessToken,
} from "../../homeassistant-frontend/src/util/brands-url";
import {
showHacsCustomRepositoriesDialog,
showHacsFormDialog,
Expand Down Expand Up @@ -114,6 +118,16 @@ export class HacsDashboard extends LitElement {
@state()
private _overflowMenuRepository?: RepositoryBase;

protected firstUpdated(changedProps: PropertyValues): void {
super.firstUpdated(changedProps);
fetchAndScheduleBrandsAccessToken(this.hass);
}

public disconnectedCallback(): void {
super.disconnectedCallback();
clearBrandsTokenRefresh();
}

protected render = (): TemplateResult | void => {
const repositories = this._filterRepositories(
this.hacs.repositories,
Expand Down Expand Up @@ -330,7 +344,6 @@ export class HacsDashboard extends LitElement {
src=${brandsUrl({
domain: repository.domain || "invalid",
type: "icon",
useFallback: true,
darkOptimized: this.hass.themes?.darkMode,
})}
referrerpolicy="no-referrer"
Expand Down