Skip to content

Commit

Permalink
fix(RV-431): Fix multiple page uniqueness for fields
Browse files Browse the repository at this point in the history
  • Loading branch information
knguyenrise8 committed Dec 20, 2024
1 parent 077d841 commit ad20cab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/pages/AnnotateTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,15 @@ const AnnotateTemplate: React.FC = () => {
color: item.color.slice(0, 7),
});
const tempFields = [...fields];
// get all fields for all indexes and
const uniqueFields = new Set();
fields.forEach((field) => {
field.forEach((f) => {
uniqueFields.add(f);
});
});
const tempMap = new Map(localIds);
if (!tempFields[index].has(item.name)) {
if (!tempFields[index].has(item.name) && !uniqueFields.has(item.name)) {
annotator!.drawRectangle();
tempFields[index].add(item.name);
tempMap.set(
Expand Down Expand Up @@ -207,7 +214,6 @@ const AnnotateTemplate: React.FC = () => {
<UploadHeader
title="Annotate new template"
onBack={() => navigate("/new-template/upload")}
onSubmit={handleSubmit}
/>
<Divider margin="0px" />
<div className="display-flex flex-justify-center padding-top-4">
Expand Down

0 comments on commit ad20cab

Please sign in to comment.