diff --git a/web/src/store/inventory.ts b/web/src/store/inventory.ts index 32ddc5a397..325b00d3ce 100644 --- a/web/src/store/inventory.ts +++ b/web/src/store/inventory.ts @@ -46,8 +46,15 @@ export const inventorySlice = createSlice({ ) => { state.contextMenu = action.payload; }, - setAdditionalMetadata: (state, action: PayloadAction>) => { - state.additionalMetadata = [ ...state.additionalMetadata, ...action.payload ]; + setAdditionalMetadata: (state, action: PayloadAction>) => { + const metadata = []; + + for (let i = 0; i < action.payload.length; i++) { + const entry = action.payload[i]; + if (!state.additionalMetadata.find((el) => el.value === entry.value)) metadata.push(entry); + } + + state.additionalMetadata = [...state.additionalMetadata, ...metadata]; }, setItemAmount: (state, action: PayloadAction) => { state.itemAmount = action.payload;