mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Allow helpers to access site settings
Since `Discourse.SiteSettings` is removed, helpers can now include and call `helperContext().siteSettings` to get access to the settings without using a global variable.
This commit is contained in:
@@ -45,6 +45,17 @@ export function registerHelpers(registry) {
|
||||
});
|
||||
}
|
||||
|
||||
let _helperContext;
|
||||
export function createHelperContext(siteSettings) {
|
||||
_helperContext = {
|
||||
siteSettings
|
||||
};
|
||||
}
|
||||
|
||||
export function helperContext() {
|
||||
return _helperContext;
|
||||
}
|
||||
|
||||
function resolveParams(ctx, options) {
|
||||
let params = {};
|
||||
const hash = options.hash;
|
||||
|
||||
Reference in New Issue
Block a user