Skip to content

[10.10.1] backport #3923 (Fix dual telemetry in receiver tab for local builds) #4384

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

Draft
wants to merge 1 commit into
base: 10.10-maintenance
Choose a base branch
from
Draft
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
35 changes: 19 additions & 16 deletions src/js/Features.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,29 @@ const Features = function (config) {

self._features = features;

// Filter features based on build options
if (semver.gte(config.apiVersion, API_VERSION_1_45) && config.buildOptions.length) {
self._features = [];

for (const feature of features) {
if (config.buildOptions.some(opt => opt.includes(feature.dependsOn)) || feature.dependsOn === undefined) {
self._features.push(feature);
if (config.buildOptions?.length) {
// Filter features based on build options
if (semver.gte(config.apiVersion, API_VERSION_1_45)) {
self._features = [];

for (const feature of features) {
if (config.buildOptions.some(opt => opt.includes(feature.dependsOn)) || feature.dependsOn === undefined) {
self._features.push(feature);
}
}
}
}

// Add TELEMETRY feature if any of the following protocols are used: CRSF, GHST, FPORT
if (semver.gte(config.apiVersion, API_VERSION_1_46)) {
let enableTelemetry = false;
if (config.buildOptions.some(opt => opt.includes('CRSF') || opt.includes('GHST') || opt.includes('FPORT'))) {
enableTelemetry = true;
}
// Add TELEMETRY feature if any of the following protocols are used: CRSF, GHST, FPORT
if (semver.gte(config.apiVersion, API_VERSION_1_46)) {
let enableTelemetry = false;
if (config.buildOptions.some(opt => opt.includes('CRSF') || opt.includes('GHST') || opt.includes('FPORT'))) {
enableTelemetry = true;
}

if (enableTelemetry) {
self._features.push({bit: 10, group: 'telemetry', name: 'TELEMETRY', haveTip: true, dependsOn: 'TELEMETRY'});
const telemetryFeature = self._features.filter(f => f.name === 'TELEMETRY')?.[0];
if (enableTelemetry && !telemetryFeature) {
self._features.push({bit: 10, group: 'telemetry', name: 'TELEMETRY', haveTip: true, dependsOn: 'TELEMETRY'});
}
}
}

Expand Down
Loading