[WEB-1607[ fix: state dropwdown default state. (#4816)

This commit is contained in:
Prateek Shourya 2024-06-14 16:45:06 +05:30 committed by GitHub
parent d1bfed950a
commit fd9f0fb17c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
const { fetchProjectStates, getProjectStates, getStateById } = useProjectState();
const statesList = getProjectStates(projectId);
const defaultState = statesList?.find((state) => state.default);
const stateValue = value ?? (showDefaultState ? defaultState?.id : undefined);
const stateValue = !!value ? value : showDefaultState ? defaultState?.id : undefined;
const options = statesList?.map((state) => ({
value: state.id,