@@ -173,7 +173,7 @@ const DroneSpecificSocketEvents = Object.freeze({
173173
174174const ParamSpecificSocketEvents = Object . freeze ( {
175175 onRebootAutopilot : "reboot_autopilot" ,
176- onParamsMessage : "params " ,
176+ onGetParamsResult : "get_params_result " ,
177177 onParamRequestUpdate : "param_request_update" ,
178178 onParamSetSuccess : "param_set_success" ,
179179 onParamError : "params_error" ,
@@ -470,7 +470,6 @@ const socketMiddleware = (store) => {
470470 store . dispatch ( setConnecting ( false ) )
471471 store . dispatch ( setConnectionModal ( false ) )
472472
473- store . dispatch ( setHasFetchedOnce ( false ) )
474473 store . dispatch ( setGuidedModePinData ( { lat : 0 , lon : 0 , alt : 0 } ) )
475474 store . dispatch ( setRebootData ( { } ) )
476475 store . dispatch ( setAutoPilotRebootModalOpen ( false ) )
@@ -870,9 +869,12 @@ const socketMiddleware = (store) => {
870869 } ,
871870 )
872871
873- socket . socket . on ( ParamSpecificSocketEvents . onParamsMessage , ( msg ) => {
874- store . dispatch ( setParams ( msg ) )
875- store . dispatch ( setShownParams ( msg ) )
872+ socket . socket . on ( ParamSpecificSocketEvents . onGetParamsResult , ( msg ) => {
873+ if ( msg . success ) {
874+ store . dispatch ( setParams ( msg . data ) )
875+ store . dispatch ( setShownParams ( msg . data ) )
876+ }
877+ store . dispatch ( setHasFetchedOnce ( true ) )
876878 store . dispatch ( setFetchingVars ( false ) )
877879 store . dispatch ( setFetchingVarsProgress ( { progress : 0 , param_id : "" } ) )
878880 store . dispatch ( setParamSearchValue ( "" ) )
0 commit comments