ソースを参照

Give ESP time to restart after write and disable button until initialized

Paulus Schoutsen 3 年 前
コミット
4c58f97981
1 ファイル変更4 行追加1 行削除
  1. 4 1
      src/install-dialog.ts

+ 4 - 1
src/install-dialog.ts

@@ -466,6 +466,7 @@ class EwtInstallDialog extends LitElement {
         <ewt-button
           slot="primaryAction"
           .label=${supportsImprov ? "Next" : "Close"}
+          .disabled=${this._client === undefined}
           dialogAction=${ifDefined(supportsImprov ? undefined : "close")}
           @click=${!supportsImprov
             ? undefined
@@ -636,7 +637,9 @@ class EwtInstallDialog extends LitElement {
         this._installState = state;
 
         if (state.state === FlashStateType.FINISHED) {
-          this._initialize().then(() => this.requestUpdate());
+          sleep(100)
+            .then(() => this._initialize())
+            .then(() => this.requestUpdate());
         }
       },
       this.port,