Skip to content

Commit 0a0e837

Browse files
author
Akos Kitta
committed
fix: simplify equals check
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 9b8e941 commit 0a0e837

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

arduino-ide-extension/src/common/protocol/monitor-service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,10 @@ export function monitorConnectionStatusEquals(
190190
left: MonitorConnectionStatus,
191191
right: MonitorConnectionStatus
192192
): boolean {
193-
if (typeof left === 'string') {
194-
return typeof right === 'string' ? left === right : false;
193+
if (typeof left === 'object' && typeof right === 'object') {
194+
return left.errorMessage === right.errorMessage;
195195
}
196-
return typeof right === 'object'
197-
? right.errorMessage === left.errorMessage
198-
: false;
196+
return left === right;
199197
}
200198

201199
/**

0 commit comments

Comments
 (0)