From 476ed0468f3c2bc24990392d53716c25a7e86011 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 12 Oct 2022 10:08:39 -0400 Subject: [PATCH] Remove piwik config fallback for privacy policy URL (#9390) * Remove piwik config fallback for privacy policy URL * Clean up imports --- src/IConfigOptions.ts | 3 --- src/toasts/AnalyticsToast.tsx | 13 +------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/IConfigOptions.ts b/src/IConfigOptions.ts index 68d133ecd0..b45461618e 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 c7f2bdb59a..9a1ea00860 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 = () => { @@ -78,16 +76,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 => {