mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-01-20 20:01:18 +00:00
fix removing custom profile image bug
This commit is contained in:
parent
975331c23d
commit
594784e77a
@ -30,13 +30,16 @@ export const GroupSubheaderForm = ({
|
||||
useEffect(() => {
|
||||
if (groupTypes && groupStates) {
|
||||
const groupType = groupTypes.find((gt) => gt.groupTypes_id.name === state.group_type)
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(state.group_type)
|
||||
const customImage = !groupTypes.some(
|
||||
(gt) => gt.groupTypes_id.image === state.image || !state.image,
|
||||
)
|
||||
setState((prevState) => ({
|
||||
...prevState,
|
||||
color: groupType?.groupTypes_id.color || groupTypes[0].groupTypes_id.color,
|
||||
marker_icon: groupType?.groupTypes_id.markerIcon || groupTypes[0].groupTypes_id.markerIcon,
|
||||
image: groupType?.groupTypes_id.image || groupTypes[0].groupTypes_id.image,
|
||||
image: customImage
|
||||
? state.image
|
||||
: groupType?.groupTypes_id.image || groupTypes[0].groupTypes_id.image,
|
||||
status: state.status || groupStates[0],
|
||||
group_type: state.group_type || groupTypes[0].groupTypes_id.name,
|
||||
}))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user