mirror of https://github.com/vector-im/riot-web
Remove piwik config fallback for privacy policy URL (#9390)
* Remove piwik config fallback for privacy policy URL * Clean up importspull/28217/head
parent
533eda2273
commit
476ed0468f
|
@ -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
|
||||
|
|
|
@ -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<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 => {
|
||||
|
|
Loading…
Reference in New Issue