Skip to content

Commit 84569e9

Browse files
committed
🙈 oops.. goes with 4566a92
1 parent 4566a92 commit 84569e9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

dash-renderer/src/actions/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ function inputsToDict(inputs_list) {
531531
// returns an Object (map):
532532
// keys of the form `id.property` or `{"id": 0}.property`
533533
// values contain the property value
534+
if (!inputs_list){
535+
return {};
536+
}
534537
const inputs = {};
535538
for (let i = 0; i < inputs_list.length; i++) {
536539
if (Array.isArray(inputs_list[i])) {
@@ -539,11 +542,11 @@ function inputsToDict(inputs_list) {
539542
const id_str = `${JSON.stringify(inputsi[ii].id)}.${
540543
inputsi[ii].property
541544
}`;
542-
inputs[id_str] = inputsi[ii].value;
545+
inputs[id_str] = inputsi[ii].value ? inputsi[ii].value : null;
543546
}
544547
} else {
545548
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;
547550
}
548551
}
549552
return inputs;
@@ -578,9 +581,10 @@ function handleClientside(clientside_function, payload) {
578581
prop_id => ({prop_id: prop_id, value: input_dict[prop_id]})
579582
);
580583
}
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);
584588

585589
const {namespace, function_name} = clientside_function;
586590
let args = inputs.map(getVals);

0 commit comments

Comments
 (0)