Skip to content

Commit

Permalink
buttons: don't show analog segment if not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Jun 29, 2022
1 parent 22a578e commit 2186753
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/composables/use-grid-segments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,18 @@ export const useGridSegments = (
semverLt(semverClean(deviceState.firmwareVersion), "5.4.0") ||
semverGt(semverClean(deviceState.firmwareVersion), "6.5.0")
) {
segments.push(
{
title: "Buttons",
startIndex: 0,
endIndex:
buttonCount.value -
analogCount.value -
touchScreenCount.value -
1,
},
{
segments.push({
title: "Buttons",
startIndex: 0,
endIndex:
buttonCount.value -
analogCount.value -
touchScreenCount.value -
1,
});

if (analogCount.value > 0) {
segments.push({
title: "Analog",
startIndex:
buttonCount.value -
Expand All @@ -74,8 +75,8 @@ export const useGridSegments = (
analogCount.value -
touchScreenCount.value +
analogCount.value,
},
);
});
}

if (touchScreenCount.value > 0) {
segments.push({
Expand Down

0 comments on commit 2186753

Please sign in to comment.