fix: fixed selected value getting reset for variables and refetch not going (#7115)

This commit is contained in:
SagarRajput-7 2025-02-15 00:23:33 +05:30 committed by GitHub
parent 966f11fd5c
commit 43a1fa53aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,12 +150,14 @@ function VariableItem({
let allSelected = false; let allSelected = false;
// The default value for multi-select is ALL and first value for // The default value for multi-select is ALL and first value for
// single select // single select
if (valueNotInList) {
if (variableData.multiSelect) { if (variableData.multiSelect) {
value = newOptionsData; value = newOptionsData;
allSelected = true; allSelected = true;
} else { } else {
[value] = newOptionsData; [value] = newOptionsData;
} }
}
if (variableData && variableData?.name && variableData?.id) { if (variableData && variableData?.name && variableData?.id) {
onValueUpdate(variableData.name, variableData.id, value, allSelected); onValueUpdate(variableData.name, variableData.id, value, allSelected);
@ -226,6 +228,9 @@ function VariableItem({
} }
setErrorMessage(message); setErrorMessage(message);
} }
setVariablesToGetUpdated((prev) =>
prev.filter((v) => v !== variableData.name),
);
}, },
}, },
); );