Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Remove piwik config fallback for privacy policy URL #9390

Merged
merged 2 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions src/IConfigOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions src/toasts/AnalyticsToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -78,16 +76,7 @@ const onLearnMorePreviouslyOptedIn = () => {
const TOAST_KEY = "analytics";

export function getPolicyUrl(): Optional<string> {
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<SnakedObject<Extract<IConfigOptions["piwik"], object>>>;
if (typeof piwikConfig === 'object') {
piwik = new SnakedObject(piwikConfig);
}
return piwik?.get("policy_url");
return SdkConfig.get("privacy_policy_url");
}

export const showToast = (): void => {
Expand Down