Skip to content

Commit b52439f

Browse files
FIX: Restore backwards compatibility for @params argument (#85)
1 parent 95cb64b commit b52439f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

javascripts/discourse/components/right-sidebar-blocks.gjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ export default class RightSidebarBlocks extends Component {
2525

2626
if (block.component) {
2727
block.classNames = `rs-component rs-${block.name}`;
28-
block.parsedParams = {};
28+
29+
const parsedParams = {};
2930
if (block.params) {
3031
block.params.forEach((p) => {
31-
block.parsedParams[p.name] = p.value;
32+
parsedParams[p.name] = p.value;
3233
});
3334
}
3435

36+
// `params` key is for backwards compatibility.
37+
// New components can use the top level curried arguments
38+
block.parsedParams = { params: parsedParams, ...parsedParams };
39+
3540
blocksArray.push(block);
3641
} else {
3742
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)