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:
Robin Ward
2020-07-22 13:13:12 -04:00
parent 939fae3500
commit c1bcb78441
7 changed files with 42 additions and 22 deletions

View File

@@ -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;