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

This commit is contained in:
Paulus Schoutsen 2021-11-10 21:36:49 -08:00
parent 87c95de8f0
commit 4c58f97981

View File

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