From 29eb9dda59c71f8f2cb183e454a7d53c84bd8a2c Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 12 Jul 2018 15:36:38 +1000 Subject: [PATCH] DEV: add deprecation for currentThemeKey This ensures that theme components will not explode when attempting to access this --- .../javascripts/discourse/lib/theme-selector.js.es6 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/theme-selector.js.es6 b/app/assets/javascripts/discourse/lib/theme-selector.js.es6 index 53b8c00d46a..1c5d9c4f39f 100644 --- a/app/assets/javascripts/discourse/lib/theme-selector.js.es6 +++ b/app/assets/javascripts/discourse/lib/theme-selector.js.es6 @@ -1,6 +1,17 @@ import { ajax } from "discourse/lib/ajax"; +import deprecated from "discourse-common/lib/deprecated"; + const keySelector = "meta[name=discourse_theme_id]"; +export function currentThemeKey() { + if (console && console.warn && console.trace) { + // TODO: Remove this code Jan 2019 + deprecated( + "'currentThemeKey' is is deprecated use 'currentThemeId' instead. A theme component may require updating." + ); + } +} + export function currentThemeId() { let themeId = null; let elem = _.first($(keySelector));