From 24217eede4cad08ee3869e9c1cc89192340e26ce Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Mon, 29 Jul 2024 09:31:44 +0100 Subject: [PATCH] Update connection lib --- package-lock.json | 8 ++++---- package.json | 2 +- src/device/mock.ts | 2 +- src/device/simulator.ts | 4 ++-- src/project/project-actions.tsx | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 48ef26537..a95b0ed37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@codemirror/view": "^6.26.3", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", - "@microbit/microbit-connection": "^0.0.0-alpha.10", + "@microbit/microbit-connection": "^0.0.0-alpha.14", "@microbit/microbit-fs": "^0.9.2", "@sanity/block-content-to-react": "^3.0.0", "@sanity/image-url": "^1.0.1", @@ -4020,9 +4020,9 @@ } }, "node_modules/@microbit/microbit-connection": { - "version": "0.0.0-alpha.10", - "resolved": "https://registry.npmjs.org/@microbit/microbit-connection/-/microbit-connection-0.0.0-alpha.10.tgz", - "integrity": "sha512-O0jAgza3448k26R9/u7IUfMvtmBLkMVOdNQOIDIWckAeC+3AQy0YcpHm9sCXJNw8AEITL2whRc05hQjwigwTrg==", + "version": "0.0.0-alpha.14", + "resolved": "https://registry.npmjs.org/@microbit/microbit-connection/-/microbit-connection-0.0.0-alpha.14.tgz", + "integrity": "sha512-Z6PsxYTO359KD5hah0JOlxxehhlzmd7Q45NcrDYT6njTjbAT9FbSF4KnnQbgnbRgePmBzW4q/HAUl89Nvqevdw==", "dependencies": { "@microbit/microbit-universal-hex": "^0.2.2", "@types/web-bluetooth": "^0.0.20", diff --git a/package.json b/package.json index 248dde57b..1d63330b9 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@codemirror/view": "^6.26.3", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", - "@microbit/microbit-connection": "^0.0.0-alpha.10", + "@microbit/microbit-connection": "^0.0.0-alpha.14", "@microbit/microbit-fs": "^0.9.2", "@sanity/block-content-to-react": "^3.0.0", "@sanity/image-url": "^1.0.1", diff --git a/src/device/mock.ts b/src/device/mock.ts index bfddcb409..9f3418f56 100644 --- a/src/device/mock.ts +++ b/src/device/mock.ts @@ -93,7 +93,7 @@ export class MockDeviceConnection } async disconnect(): Promise { - this.setStatus(ConnectionStatus.NOT_CONNECTED); + this.setStatus(ConnectionStatus.DISCONNECTED); } async serialWrite(data: string): Promise { diff --git a/src/device/simulator.ts b/src/device/simulator.ts index c5fc03c43..fa97a1a51 100644 --- a/src/device/simulator.ts +++ b/src/device/simulator.ts @@ -291,7 +291,7 @@ export class SimulatorDeviceConnection async initialize(): Promise { window.addEventListener("message", this.messageListener); - this.setStatus(ConnectionStatus.NOT_CONNECTED); + this.setStatus(ConnectionStatus.DISCONNECTED); } dispose() { @@ -334,7 +334,7 @@ export class SimulatorDeviceConnection async disconnect(): Promise { window.removeEventListener("message", this.messageListener); - this.setStatus(ConnectionStatus.NOT_CONNECTED); + this.setStatus(ConnectionStatus.DISCONNECTED); } async serialWrite(data: string): Promise { diff --git a/src/project/project-actions.tsx b/src/project/project-actions.tsx index 9d2ece11d..46e4e8668 100644 --- a/src/project/project-actions.tsx +++ b/src/project/project-actions.tsx @@ -158,7 +158,7 @@ export class ProjectActions { if ( !force && (!showConnectHelpSetting || - this.device.status === ConnectionStatus.NOT_CONNECTED) + this.device.status === ConnectionStatus.DISCONNECTED) ) { return true; } @@ -511,7 +511,7 @@ export class ProjectActions { if ( this.device.status === ConnectionStatus.NO_AUTHORIZED_DEVICE || - this.device.status === ConnectionStatus.NOT_CONNECTED + this.device.status === ConnectionStatus.DISCONNECTED ) { const connected = await this.connect( tryAgain || false,