FIX: Prevent duplicate params for raw template theme handlebars helpers

This commit is contained in:
David Taylor
2019-02-08 12:54:00 +00:00
parent e3324737ee
commit 95b5c5898e
3 changed files with 14 additions and 6 deletions

View File

@ -64,11 +64,13 @@ class ThemeJavascriptCompiler
function manipulateNode(node) {
// Magically add theme id as the first param for each of these helpers
if (node.path.parts && ["theme-i18n", "theme-prefix", "theme-setting"].includes(node.path.parts[0])) {
node.params.unshift({
type: "NumberLiteral",
value: #{@theme_id},
original: #{@theme_id}
})
if(node.params.length === 1){
node.params.unshift({
type: "NumberLiteral",
value: #{@theme_id},
original: #{@theme_id}
})
}
}
// Override old themeSetting syntax when it's in its own node