diff --git a/apps/desktop/src/lib/trpc/routers/settings/index.ts b/apps/desktop/src/lib/trpc/routers/settings/index.ts index 357d00f16f7..d04925039a9 100644 --- a/apps/desktop/src/lib/trpc/routers/settings/index.ts +++ b/apps/desktop/src/lib/trpc/routers/settings/index.ts @@ -12,7 +12,6 @@ import { localDb } from "main/lib/local-db"; import { DEFAULT_AUTO_APPLY_DEFAULT_PRESET, DEFAULT_CONFIRM_ON_QUIT, - DEFAULT_TELEMETRY_ENABLED, DEFAULT_TERMINAL_LINK_BEHAVIOR, } from "shared/constants"; import { DEFAULT_RINGTONE_ID, RINGTONES } from "shared/ringtones"; @@ -386,23 +385,14 @@ export const createSettingsRouter = () => { return { success: true }; }), + // TODO: remove telemetry procedures once telemetry_enabled column is dropped getTelemetryEnabled: publicProcedure.query(() => { - const row = getSettings(); - return row.telemetryEnabled ?? DEFAULT_TELEMETRY_ENABLED; + return true; }), setTelemetryEnabled: publicProcedure .input(z.object({ enabled: z.boolean() })) - .mutation(({ input }) => { - localDb - .insert(settings) - .values({ id: 1, telemetryEnabled: input.enabled }) - .onConflictDoUpdate({ - target: settings.id, - set: { telemetryEnabled: input.enabled }, - }) - .run(); - + .mutation(() => { return { success: true }; }), }); diff --git a/apps/desktop/src/main/lib/analytics/index.ts b/apps/desktop/src/main/lib/analytics/index.ts index 9857e78073b..a81044fee55 100644 --- a/apps/desktop/src/main/lib/analytics/index.ts +++ b/apps/desktop/src/main/lib/analytics/index.ts @@ -1,7 +1,5 @@ -import { settings } from "@superset/local-db"; import { app } from "electron"; import { env } from "main/env.main"; -import { localDb } from "main/lib/local-db"; import { PostHog } from "posthog-node"; import { DEFAULT_TELEMETRY_ENABLED } from "shared/constants"; @@ -24,12 +22,7 @@ function getClient(): PostHog | null { } function isTelemetryEnabled(): boolean { - try { - const row = localDb.select().from(settings).get(); - return row?.telemetryEnabled ?? DEFAULT_TELEMETRY_ENABLED; - } catch { - return DEFAULT_TELEMETRY_ENABLED; - } + return DEFAULT_TELEMETRY_ENABLED; } export function setUserId(id: string | null): void { diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/behavior/components/BehaviorSettings/BehaviorSettings.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/behavior/components/BehaviorSettings/BehaviorSettings.tsx index 1cd6e500258..56addf8f714 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/behavior/components/BehaviorSettings/BehaviorSettings.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/behavior/components/BehaviorSettings/BehaviorSettings.tsx @@ -62,6 +62,7 @@ export function BehaviorSettings({ visibleItems }: BehaviorSettingsProps) { setConfirmOnQuit.mutate({ enabled }); }; + // TODO: remove telemetry query/mutation/handler once telemetry procedures are removed const { data: telemetryEnabled, isLoading: isTelemetryLoading } = electronTrpc.settings.getTelemetryEnabled.useQuery(); const setTelemetryEnabled = @@ -221,7 +222,7 @@ export function BehaviorSettings({ visibleItems }: BehaviorSettingsProps) { )} - {showTelemetry && ( + {false && showTelemetry && (