Skip to content

Commit

Permalink
feat: fix cli and presets tab on web
Browse files Browse the repository at this point in the history
  • Loading branch information
chmelevskij committed Apr 27, 2024
1 parent 269f1b5 commit 67b9c8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/js/tabs/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import BuildApi from '../BuildApi';
import { tracking } from '../Analytics';
import { reinitializeConnection } from "../serial_backend";
import CONFIGURATOR from "../data_storage";
import serial from "../serial";
import CliAutoComplete from "../CliAutoComplete";
import UI_PHONES from "../phones_ui";
import { gui_log } from "../gui_log";
import jBox from "jbox";
import { checkChromeRuntimeError } from "../utils/common";
import $ from 'jquery';
import { serialShim } from "../serial_shim";

const serial = serialShim();

const cli = {
lineDelayMs: 15,
Expand Down Expand Up @@ -446,7 +448,7 @@ cli.read = function (readInfo) {
Windows understands (both) CRLF
Chrome OS currently unknown
*/
const data = new Uint8Array(readInfo.data);
const data = new Uint8Array(readInfo.data ?? readInfo);
let validateText = "";
let sequenceCharsToSkip = 0;

Expand Down
6 changes: 4 additions & 2 deletions src/tabs/presets/CliEngine.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import GUI from "../../js/gui";
import { i18n } from "../../js/localization";
import CONFIGURATOR from "../../js/data_storage";
import serial from "../../js/serial";
import { reinitializeConnection } from "../../js/serial_backend";
import { gui_log } from "../../js/gui_log";
import { serialShim } from "../../js/serial_shim";

const serial = serialShim();

export default class CliEngine
{
Expand Down Expand Up @@ -186,7 +188,7 @@ export default class CliEngine
Windows understands (both) CRLF
Chrome OS currently unknown
*/
const data = new Uint8Array(readInfo.data);
const data = new Uint8Array(readInfo.data ?? readInfo);
let validateText = "";
let sequenceCharsToSkip = 0;
for (const charCode of data) {
Expand Down

0 comments on commit 67b9c8c

Please sign in to comment.