File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,7 @@ export class DeviceService {
8
8
private deviceType : string = '' ;
9
9
private decoder : TextDecoder = new TextDecoder ( ) ;
10
10
11
- constructor ( ) {
12
- // Contiuously check the port status every 2 seconds to update the connection status/card
13
- setInterval ( ( ) => {
14
- console . log ( '[DeviceService]: Checking port status...' ) ;
15
- if ( this . port && ! this . port . readable && ! this . port . writable ) {
16
- console . log ( '[DeviceService]: Port is not readable or writable, disconnecting...' ) ;
17
- this . disconnect ( ) ;
18
- }
19
- } , 2000 ) ;
20
-
21
- }
11
+ constructor ( ) { }
22
12
23
13
// Check if port is available (return true if available)
24
14
// Don't run if we are already connected from within this tab
@@ -107,6 +97,15 @@ export class DeviceService {
107
97
detail : { msg : "Connected" }
108
98
} ) ;
109
99
document . dispatchEvent ( event )
100
+
101
+ // Contiuously check the port status every 2 seconds to update the connection status/card
102
+ setInterval ( ( ) => {
103
+ console . log ( '[DeviceService]: Checking port status...' ) ;
104
+ if ( this . port && ! this . port . readable && ! this . port . writable ) {
105
+ console . log ( '[DeviceService]: Port is not readable or writable, disconnecting...' ) ;
106
+ this . disconnect ( ) ;
107
+ }
108
+ } , 2000 ) ;
110
109
}
111
110
112
111
async disconnect ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments