minor fix

This commit is contained in:
xenkuo 2020-07-28 21:23:27 +08:00
parent 626ef264f6
commit 1c4f2dfb3e
2 changed files with 7 additions and 4 deletions

View File

@ -787,10 +787,10 @@ document.getElementById("capture-file-switch").onclick = (e) => {
filters: [{ name: "comNG Log", extensions: ["cnl"] }],
})
.then((result) => {
let e = document.getElementById("capture-file-path");
let pathEle = document.getElementById("capture-file-path");
if (result.canceled === false) {
let path = result.filePath;
e.value = path;
pathEle.value = path;
captureFileStream = fs.createWriteStream(path, { flags: "a" });
configUpdate("advance.capture.switch", true);
@ -798,10 +798,13 @@ document.getElementById("capture-file-switch").onclick = (e) => {
} else {
if (undefined !== captureFileStream) captureFileStream.end();
captureFileStream = undefined;
e.value = "";
pathEle.value = "";
configUpdate("advance.capture.switch", false);
configUpdate("advance.capture.filePath", "");
// restore check status
e.target.checked = false;
}
});
} else {

View File

@ -162,7 +162,7 @@ document.getElementById("port-switch").onclick = (e) => {
// Set below signal will cause some device reboot.
// port.set({ rts: true, dtr: true }, (e) => {
// if (e !== null) console.error(e);
// });git
// });
});
port.on("error", (e) => {