mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 08:20:02 +02:00
do not try to update state if it is not yet set
This happens when the backend pushes updates before the frontend has received and set the state when loading the page, first.
This commit is contained in:
parent
8b1f1ef1b1
commit
dba036c6b3
@ -32,6 +32,9 @@ const reducer = (state: State, action: Action): State => {
|
|||||||
case 'SET_DATA':
|
case 'SET_DATA':
|
||||||
return action.data;
|
return action.data;
|
||||||
case 'UPDATE_ATTRIBUTE': {
|
case 'UPDATE_ATTRIBUTE': {
|
||||||
|
if (state === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
value: setNestedValueByPath(state.value, action.fullAccessPath, action.newValue)
|
value: setNestedValueByPath(state.value, action.fullAccessPath, action.newValue)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user