mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 19:49:29 +08:00
Add deprecation for Discourse.SiteSettings
in a helper
This commit is contained in:
parent
c4d5c0c91b
commit
8456252c21
|
@ -1,5 +1,16 @@
|
||||||
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
|
||||||
export function prioritizeNameInUx(name, siteSettings) {
|
export function prioritizeNameInUx(name, siteSettings) {
|
||||||
siteSettings = siteSettings || Discourse.SiteSettings;
|
if (!siteSettings) {
|
||||||
|
deprecated(
|
||||||
|
"You must supply `prioritizeNameInUx` with a `siteSettings` object",
|
||||||
|
{
|
||||||
|
since: "2.6.0",
|
||||||
|
dropFrom: "2.7.0"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
siteSettings = Discourse.SiteSettings;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
!siteSettings.prioritize_username_in_ux && name && name.trim().length > 0
|
!siteSettings.prioritize_username_in_ux && name && name.trim().length > 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user