瀏覽代碼

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,