From 031167fbeaa17002482a7c96cfa1c70c1e322fa3 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Thu, 30 Sep 2021 10:57:39 +0530 Subject: [PATCH] Use the correct way to update the state variable using depChange method. --- .../servers/pgagent/steps/static/js/pga_jobstep.ui.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js index d0f903409..930a67999 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js +++ b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui.js @@ -119,11 +119,12 @@ export default class PgaJobStepSchema extends BaseUISchema { options: this.fieldOptions.databases, controlProps: {allowClear: true, placeholder: ''}, disabled: function(state) { - let retVal = !state.jstkind || !state.jstconntype; - if (retVal) { - state.jstdbname = null; + return !state.jstkind || !state.jstconntype; + }, + depChange: (state)=>{ + if (!state.jstkind || !state.jstconntype) { + return {jstdbname: null}; } - return retVal; }, deps: ['jstkind', 'jstconntype'], helpMessage: gettext('Please select the database on which the job step will run.'),