better flow + handle unclosed connection (#921)

* better flow + handle unclosed connection

* more checks
This commit is contained in:
Peli de Halleux
2019-09-27 09:16:27 -07:00
committed by GitHub
parent d1f11059db
commit b28b5cb6b7
3 changed files with 25 additions and 11 deletions

View File

@ -80,7 +80,6 @@ pxt.editor.initExtensionsAsync = function (opts: pxt.editor.ExtensionOptions): P
className: "bluetooth focused",
onclick: () => {
pxt.tickEvent("bluetooth.enable");
enableWebSerial();
confirmAsync({
header: lf("Bluetooth enabled"),
hasCloseIcon: true,
@ -93,7 +92,7 @@ pxt.editor.initExtensionsAsync = function (opts: pxt.editor.ExtensionOptions): P
}],
htmlBody: `
<p>
${lf("Please download again to send your code to the EV3 over Bluetooth.")}
${lf("Download again to send your code to the EV3 over Bluetooth. Make sure to stop your program!")}
</p>
<p>
${lf("You will be prompted to select a serial port.")}
@ -101,6 +100,8 @@ ${lf("On Windows, look for 'Standard Serial over Bluetooth link'.")}
${lf("If you have paired multiple EV3, you might have to try out multiple ports until you find the correct one.")}
</p>
`
}).then(() => {
enableWebSerial();
})
}
} : undefined, downloadAgain ? {