Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed May 21, 2021
1 parent 53ffc99 commit f4035df
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/provision-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,15 @@ class ProvisionDialog extends LitElement {

protected firstUpdated(changedProps: PropertyValues) {
super.firstUpdated(changedProps);

this.device.addEventListener("gattserverdisconnected", () => {
this._state = "disconnected";
});
this._connect();
}

protected updated(changedProps: PropertyValues) {
super.updated(changedProps);

if (!this.device.gatt!.connected) {
this._connect();
}

if (
(changedProps.has("_improvCurrentState") || changedProps.has("_state")) &&
this._state === "improv-state" &&
Expand Down Expand Up @@ -294,7 +290,6 @@ class ProvisionDialog extends LitElement {
private _rpcWriteSettings() {
const encoder = new TextEncoder();
const ssidEncoded = encoder.encode(this._inputSSID.value);
console.log({ ssid: this._inputSSID.value, pw: this._inputPassword.value });
const pwEncoded = encoder.encode(this._inputPassword.value);
const data = new Uint8Array([
ssidEncoded.length,
Expand Down

0 comments on commit f4035df

Please sign in to comment.