Pārlūkot izejas kodu

Only show 'Visit device URL' if we have a url

Paulus Schoutsen 3 gadi atpakaļ
vecāks
revīzija
87c95de8f0
1 mainītis faili ar 16 papildinājumiem un 12 dzēšanām
  1. 16 12
      src/install-dialog.ts

+ 16 - 12
src/install-dialog.ts

@@ -272,18 +272,22 @@ class EwtInstallDialog extends LitElement {
         ${showSetupLinks
           ? html`
               <div class="dashboard-buttons">
-                <div>
-                  <a
-                    href=${this._client!.nextUrl}
-                    class="has-button"
-                    target="_blank"
-                    @click=${() => {
-                      this._state = "DASHBOARD";
-                    }}
-                  >
-                    <ewt-button label="Visit Device"></ewt-button>
-                  </a>
-                </div>
+                ${this._client!.nextUrl === undefined
+                  ? ""
+                  : html`
+                      <div>
+                        <a
+                          href=${this._client!.nextUrl}
+                          class="has-button"
+                          target="_blank"
+                          @click=${() => {
+                            this._state = "DASHBOARD";
+                          }}
+                        >
+                          <ewt-button label="Visit Device"></ewt-button>
+                        </a>
+                      </div>
+                    `}
                 ${!this._manifest.home_assistant_domain
                   ? ""
                   : html`