Skip to content

Commit

Permalink
Merge pull request #6038 from gitbutlerapp/refactor-telemetry-setting…
Browse files Browse the repository at this point in the history
…s-types

refactor: simplify telemetry and feature flags updates
  • Loading branch information
krlvi authored Jan 21, 2025
2 parents 19eb588 + 339ed3c commit 726edf2
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions apps/desktop/src/lib/config/appSettingsV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export class SettingsService {
await invoke('update_onboarding_complete', { update });
}

async updateTelemetry(update: TelemetryUpdate) {
async updateTelemetry(update: Partial<TelemetrySettings>) {
await invoke('update_telemetry', { update });
}

async updateFeatureFlags(update: FeatureFlagsUpdate) {
async updateFeatureFlags(update: Partial<FeatureFlags>) {
await invoke('update_feature_flags', { update });
}

Expand Down Expand Up @@ -67,21 +67,7 @@ export type TelemetrySettings = {
appNonAnonMetricsEnabled: boolean;
};

/** Request updating the TelemetrySettings. Only the fields that are set are updated */
export type TelemetryUpdate = {
/** Whether the anonymous metrics are enabled. */
appMetricsEnabled: boolean | undefined;
/** Whether anonymous error reporting is enabled. */
appErrorReportingEnabled: boolean | undefined;
/** Whether non-anonymous metrics are enabled. */
appNonAnonMetricsEnabled: boolean | undefined;
};

export type FeatureFlags = {
/** Enables the v3 design, as well as the purgatory mode (no uncommitted diff ownership assignments). */
v3: boolean;
};

export type FeatureFlagsUpdate = {
v3: boolean | undefined;
};

0 comments on commit 726edf2

Please sign in to comment.