Skip to content

Commit

Permalink
fix: add removesDefaultHiding for item edition (#2783)
Browse files Browse the repository at this point in the history
  • Loading branch information
Melisa Anabella Rossi authored Jul 24, 2023
1 parent 57a3552 commit 9f85869
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,14 @@ export default class CreateSingleItemModal extends React.PureComponent<Props, St
}

addItemRepresentation = async (sortedContents: SortedContent, representations: WearableRepresentation[]) => {
const { onSave } = this.props
const { isHandsCategoryEnabled, onSave } = this.props
const { bodyShape, item: editedItem, requiredPermissions } = this.state as StateData
const hashedContents = await computeHashes(bodyShape === BodyShapeType.MALE ? sortedContents.male : sortedContents.female)
const removesDefaultHiding =
isHandsCategoryEnabled &&
(editedItem.data.category === WearableCategory.UPPER_BODY || editedItem.data.hides.includes(WearableCategory.UPPER_BODY))
? [BodyPartCategory.HANDS]
: []
const item = {
...editedItem,
data: {
Expand All @@ -264,7 +269,7 @@ export default class CreateSingleItemModal extends React.PureComponent<Props, St
],
replaces: [...editedItem.data.replaces],
hides: [...editedItem.data.hides],
removesDefaultHiding: [...(editedItem.data.removesDefaultHiding || [])],
removesDefaultHiding: removesDefaultHiding,
tags: [...editedItem.data.tags],
requiredPermissions: requiredPermissions || []
},
Expand All @@ -281,17 +286,18 @@ export default class CreateSingleItemModal extends React.PureComponent<Props, St
}

modifyItem = async (pristineItem: Item, sortedContents: SortedContent, representations: WearableRepresentation[]) => {
const { onSave } = this.props
const { isHandsCategoryEnabled, onSave } = this.props
const { name, bodyShape, type, metrics, category, playMode, requiredPermissions } = this.state as StateData

let data: WearableData | EmoteDataADR74

if (type === ItemType.WEARABLE) {
const removesDefaultHiding = isHandsCategoryEnabled && category === WearableCategory.UPPER_BODY ? [BodyPartCategory.HANDS] : []
data = {
...pristineItem.data,
replaces: [],
hides: [],
removesDefaultHiding: [],
removesDefaultHiding,
category: category as WearableCategory,
requiredPermissions: requiredPermissions || []
} as WearableData
Expand Down

1 comment on commit 9f85869

@vercel
Copy link

@vercel vercel bot commented on 9f85869 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder – ./

builder-decentraland1.vercel.app
builder-git-master-decentraland1.vercel.app

Please sign in to comment.