Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controller): parsing semver when connecting to unit #366

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/controller/units/UnitsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import router from '@/router'
import { onMounted, type PropType, ref } from 'vue'
import { useLoginStore } from '@/stores/controller/controllerLogin'
import RemoveUnitModal from '@/components/controller/units/RemoveUnitModal.vue'
import { outside, satisfies } from 'semver'
import { coerce, outside, satisfies } from 'semver'

const props = defineProps({
filteredUnits: {
Expand Down Expand Up @@ -79,9 +79,9 @@ async function openUnit(unit: Unit, versionCheck = true) {
// Find the now updated unit, as the currentUnit might have changed
currentUnit.value = unitsStore.units.find((u) => u.id == unit.id)!
// Logic on which message is shown is inside the ObsoleteApiModal component
let version = currentUnit.value?.info.api_version
if (version == '') {
version = '0.0.0'
let version = coerce(currentUnit.value?.info.api_version)
if (version == null) {
version = coerce('0.0.0')!
}
if (versionCheck && !satisfies(version, REQUIRED_API_VERSION)) {
if (outside(version, REQUIRED_API_VERSION, '>')) {
Expand Down