@@ -596,10 +596,7 @@ impl SplitTemplateRenderer {
596
596
let blk = render_context
597
597
. block_mut ( )
598
598
. expect ( "context created without block" ) ;
599
- blk. set_local_var (
600
- "component_index" ,
601
- JsonValue :: Number ( self . component_index . into ( ) ) ,
602
- ) ;
599
+ blk. set_local_var ( "component_index" , self . component_index . into ( ) ) ;
603
600
blk. set_local_var ( "csp_nonce" , self . nonce . clone ( ) ) ;
604
601
605
602
* self . ctx . data_mut ( ) = data;
@@ -631,7 +628,8 @@ impl SplitTemplateRenderer {
631
628
* blk. local_variables_mut ( ) = local_vars;
632
629
let mut blk = BlockContext :: new ( ) ;
633
630
blk. set_base_value ( data) ;
634
- blk. set_local_var ( "row_index" , JsonValue :: Number ( self . row_index . into ( ) ) ) ;
631
+ blk. set_local_var ( "component_index" , self . component_index . into ( ) ) ;
632
+ blk. set_local_var ( "row_index" , self . row_index . into ( ) ) ;
635
633
blk. set_local_var ( "csp_nonce" , self . nonce . clone ( ) ) ;
636
634
render_context. push_block ( blk) ;
637
635
let mut output = HandlebarWriterOutput ( writer) ;
@@ -661,6 +659,7 @@ impl SplitTemplateRenderer {
661
659
if let Some ( mut local_vars) = self . local_vars . take ( ) {
662
660
let mut render_context = handlebars:: RenderContext :: new ( None ) ;
663
661
local_vars. put ( "row_index" , self . row_index . into ( ) ) ;
662
+ local_vars. put ( "component_index" , self . component_index . into ( ) ) ;
664
663
local_vars. put ( "csp_nonce" , self . nonce . clone ( ) ) ;
665
664
log:: trace!( "Rendering the after_list template with the following local variables: {local_vars:?}" ) ;
666
665
* render_context
0 commit comments