Skip to content

Commit

Permalink
Fix scraped tag name being used in matched scraped tags field (#5462)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored Nov 7, 2024
1 parent a100f8f commit 2a454e5
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ui/v2.5/src/components/Shared/ScrapeDialog/ScrapedObjectsRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ObjectScrapeResult,
ScrapeResult,
} from "src/components/Shared/ScrapeDialog/scrapeResult";
import { TagSelect } from "src/components/Tags/TagSelect";
import { TagIDSelect } from "src/components/Tags/TagSelect";
import { StudioSelect } from "src/components/Studios/StudioSelect";
import { GroupSelect } from "src/components/Groups/GroupSelect";

Expand Down Expand Up @@ -269,17 +269,12 @@ export const ScrapedTagsRow: React.FC<
: scrapeResult.originalValue;
const value = resultValue ?? [];

const selectValue = value.map((p) => {
const aliases: string[] = [];
return {
id: p.stored_id ?? "",
name: p.name ?? "",
aliases,
};
});
const selectValue = value.map((p) => p.stored_id ?? "");

// we need to use TagIDSelect here because we want to use the local name
// of the tag instead of the name from the source
return (
<TagSelect
<TagIDSelect
isMulti
className="form-control"
isDisabled={!isNew}
Expand All @@ -289,7 +284,7 @@ export const ScrapedTagsRow: React.FC<
onChangeFn(items.map((p) => ({ ...p, stored_id: p.id })));
}
}}
values={selectValue}
ids={selectValue}
/>
);
}
Expand Down

0 comments on commit 2a454e5

Please sign in to comment.