diff --git a/src/components/buttons/ha-progress-button.ts b/src/components/buttons/ha-progress-button.ts index d025cb7ff3..7b700895d7 100644 --- a/src/components/buttons/ha-progress-button.ts +++ b/src/components/buttons/ha-progress-button.ts @@ -1,6 +1,13 @@ import "@material/mwc-button"; import { mdiAlertOctagram, mdiCheckBold } from "@mdi/js"; -import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { + css, + CSSResultGroup, + html, + LitElement, + nothing, + TemplateResult, +} from "lit"; import { customElement, property, state } from "lit/decorators"; import "../ha-circular-progress"; import "../ha-svg-icon"; @@ -27,7 +34,7 @@ export class HaProgressButton extends LitElement { ${!overlay - ? "" + ? nothing : html`
${this._result === "success" diff --git a/src/panels/config/storage/dialog-mount-view.ts b/src/panels/config/storage/dialog-mount-view.ts index de8ddb1a77..0cb65707a6 100644 --- a/src/panels/config/storage/dialog-mount-view.ts +++ b/src/panels/config/storage/dialog-mount-view.ts @@ -1,9 +1,14 @@ +import { mdiHelpCircle } from "@mdi/js"; import { css, CSSResultGroup, html, LitElement, nothing } from "lit"; import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; -import { mdiHelpCircle } from "@mdi/js"; import { fireEvent } from "../../../common/dom/fire_event"; +import { LocalizeFunc } from "../../../common/translations/localize"; +import { computeRTLDirection } from "../../../common/util/compute_rtl"; +import "../../../components/buttons/ha-progress-button"; +import type { HaProgressButton } from "../../../components/buttons/ha-progress-button"; import "../../../components/ha-form/ha-form"; +import type { SchemaUnion } from "../../../components/ha-form/types"; import "../../../components/ha-icon-button"; import { extractApiErrorMessage } from "../../../data/hassio/common"; import { @@ -16,11 +21,8 @@ import { } from "../../../data/supervisor/mounts"; import { haStyle, haStyleDialog } from "../../../resources/styles"; import { HomeAssistant } from "../../../types"; -import { MountViewDialogParams } from "./show-dialog-view-mount"; -import { LocalizeFunc } from "../../../common/translations/localize"; -import type { SchemaUnion } from "../../../components/ha-form/types"; import { documentationUrl } from "../../../util/documentation-url"; -import { computeRTLDirection } from "../../../common/util/compute_rtl"; +import { MountViewDialogParams } from "./show-dialog-view-mount"; const mountSchema = memoizeOne( ( @@ -269,8 +271,8 @@ class ViewMountDialog extends LitElement { : nothing}
- @@ -281,7 +283,7 @@ class ViewMountDialog extends LitElement { : this.hass.localize( "ui.panel.config.storage.network_mounts.connect" )} - + `; } @@ -333,7 +335,8 @@ class ViewMountDialog extends LitElement { } } - private async _connectMount() { + private async _connectMount(ev) { + const progressButton = ev.target as HaProgressButton; this._error = undefined; this._waiting = true; const mountData = { ...this._data! }; @@ -349,6 +352,7 @@ class ViewMountDialog extends LitElement { } catch (err: any) { this._error = extractApiErrorMessage(err); this._waiting = false; + progressButton.actionError(); if (this._data!.type === "cifs" && !this._showCIFSVersion) { this._showCIFSVersion = true; }