mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
DEV: add deprecation for currentThemeKey
This ensures that theme components will not explode when attempting to access this
This commit is contained in:
parent
a201103127
commit
29eb9dda59
1 changed files with 11 additions and 0 deletions
|
@ -1,6 +1,17 @@
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
|
||||||
const keySelector = "meta[name=discourse_theme_id]";
|
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() {
|
export function currentThemeId() {
|
||||||
let themeId = null;
|
let themeId = null;
|
||||||
let elem = _.first($(keySelector));
|
let elem = _.first($(keySelector));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue