From 0c7a84d43c71e421e187f4d4e2b5476aacfdc383 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 11 Oct 2022 16:20:37 -0600 Subject: [PATCH 1/2] Remove piwik config fallback for privacy policy URL --- src/IConfigOptions.ts | 3 --- src/toasts/AnalyticsToast.tsx | 11 +---------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/IConfigOptions.ts b/src/IConfigOptions.ts index 91391fc2a93..8744a1a295f 100644 --- a/src/IConfigOptions.ts +++ b/src/IConfigOptions.ts @@ -141,9 +141,6 @@ export interface IConfigOptions { servers: string[]; }; - piwik?: false | { - policy_url: string; // deprecated in favour of `privacy_policy_url` at root instead - }; posthog?: { project_api_key: string; api_host: string; // hostname diff --git a/src/toasts/AnalyticsToast.tsx b/src/toasts/AnalyticsToast.tsx index c7f2bdb59af..6fa28161ed3 100644 --- a/src/toasts/AnalyticsToast.tsx +++ b/src/toasts/AnalyticsToast.tsx @@ -78,16 +78,7 @@ const onLearnMorePreviouslyOptedIn = () => { const TOAST_KEY = "analytics"; export function getPolicyUrl(): Optional { - const policyUrl = SdkConfig.get("privacy_policy_url"); - if (policyUrl) return policyUrl; - - // Try get from legacy config location - const piwikConfig = SdkConfig.get("piwik"); - let piwik: Optional>>; - if (typeof piwikConfig === 'object') { - piwik = new SnakedObject(piwikConfig); - } - return piwik?.get("policy_url"); + return SdkConfig.get("privacy_policy_url"); } export const showToast = (): void => { From 24cba0a14175fd0649f0fa670fd0d3d3e058dd6a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 11 Oct 2022 16:24:47 -0600 Subject: [PATCH 2/2] Clean up imports --- src/toasts/AnalyticsToast.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/toasts/AnalyticsToast.tsx b/src/toasts/AnalyticsToast.tsx index 6fa28161ed3..9a1ea008601 100644 --- a/src/toasts/AnalyticsToast.tsx +++ b/src/toasts/AnalyticsToast.tsx @@ -28,8 +28,6 @@ import { showDialog as showAnalyticsLearnMoreDialog, } from "../components/views/dialogs/AnalyticsLearnMoreDialog"; import { Action } from "../dispatcher/actions"; -import { SnakedObject } from "../utils/SnakedObject"; -import { IConfigOptions } from "../IConfigOptions"; import SettingsStore from "../settings/SettingsStore"; const onAccept = () => {