@@ -531,6 +531,9 @@ function inputsToDict(inputs_list) {
531
531
// returns an Object (map):
532
532
// keys of the form `id.property` or `{"id": 0}.property`
533
533
// values contain the property value
534
+ if ( ! inputs_list ) {
535
+ return { } ;
536
+ }
534
537
const inputs = { } ;
535
538
for ( let i = 0 ; i < inputs_list . length ; i ++ ) {
536
539
if ( Array . isArray ( inputs_list [ i ] ) ) {
@@ -539,11 +542,11 @@ function inputsToDict(inputs_list) {
539
542
const id_str = `${ JSON . stringify ( inputsi [ ii ] . id ) } .${
540
543
inputsi [ ii ] . property
541
544
} `;
542
- inputs [ id_str ] = inputsi [ ii ] . value ;
545
+ inputs [ id_str ] = inputsi [ ii ] . value ? inputsi [ ii ] . value : null ;
543
546
}
544
547
} else {
545
548
const id_str = `${ inputs_list [ i ] . id } .${ inputs_list [ i ] . property } ` ;
546
- inputs [ id_str ] = inputs_list [ i ] . value ;
549
+ inputs [ id_str ] = inputs_list [ i ] . value ? inputs_list [ i ] . value : null ;
547
550
}
548
551
}
549
552
return inputs ;
@@ -578,9 +581,10 @@ function handleClientside(clientside_function, payload) {
578
581
prop_id => ( { prop_id : prop_id , value : input_dict [ prop_id ] } )
579
582
) ;
580
583
}
581
- dc . callback_context . inputs_list = input_dict ;
582
- dc . callback_context . inputs = inputs ;
583
- // TODO: add the rest: states, states_list, response(??)
584
+ dc . callback_context . inputs_list = inputs ;
585
+ dc . callback_context . inputs = input_dict ;
586
+ dc . callback_context . states_list = state ;
587
+ dc . callback_context . states = inputsToDict ( state ) ;
584
588
585
589
const { namespace, function_name} = clientside_function ;
586
590
let args = inputs . map ( getVals ) ;
0 commit comments