Skip to content

Commit bce1548

Browse files
committed
Reduce
1 parent ac06e31 commit bce1548

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/js/serial_backend.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,6 @@ function showVersionMismatchAndCli(message) {
299299
connectCli();
300300
}
301301

302-
function checkApiVersionCompatibility() {
303-
const maxMajor = semver.major(CONFIGURATOR.API_VERSION_MAX_SUPPORTED);
304-
const maxMinor = semver.minor(CONFIGURATOR.API_VERSION_MAX_SUPPORTED);
305-
return semver.satisfies(FC.CONFIG.apiVersion, `<=${maxMajor}.${maxMinor}`);
306-
}
307-
308302
/**
309303
* purpose of this is to bridge the old and new api
310304
* when serial events are handled.
@@ -349,7 +343,12 @@ function onOpen(openInfo) {
349343
}
350344

351345
// Check version compatibility first
352-
if (!checkApiVersionCompatibility()) {
346+
if (
347+
!semver.satisfies(
348+
FC.CONFIG.apiVersion,
349+
`<=${semver.major(CONFIGURATOR.API_VERSION_MAX_SUPPORTED)}.${semver.minor(CONFIGURATOR.API_VERSION_MAX_SUPPORTED)}`,
350+
)
351+
) {
353352
showVersionMismatchAndCli();
354353
return;
355354
}

0 commit comments

Comments
 (0)