diff --git a/ui/v2.5/src/components/Scenes/SceneDetails/SceneScrapeDialog.tsx b/ui/v2.5/src/components/Scenes/SceneDetails/SceneScrapeDialog.tsx index c268648cc..3f4accd29 100644 --- a/ui/v2.5/src/components/Scenes/SceneDetails/SceneScrapeDialog.tsx +++ b/ui/v2.5/src/components/Scenes/SceneDetails/SceneScrapeDialog.tsx @@ -470,7 +470,11 @@ export const SceneScrapeDialog: React.FC = ({ // remove the performer from the list const newPerformersClone = newPerformers.concat(); - const pIndex = newPerformersClone.indexOf(toCreate); + const pIndex = newPerformersClone.findIndex( + (p) => p.name === toCreate.name + ); + if (pIndex === -1) throw new Error("Could not find performer to remove"); + newPerformersClone.splice(pIndex, 1); setNewPerformers(newPerformersClone); @@ -520,6 +524,7 @@ export const SceneScrapeDialog: React.FC = ({ // remove the movie from the list const newMoviesClone = newMovies.concat(); const pIndex = newMoviesClone.indexOf(toCreate); + if (pIndex === -1) throw new Error("Could not find movie to remove"); newMoviesClone.splice(pIndex, 1); setNewMovies(newMoviesClone); @@ -555,6 +560,7 @@ export const SceneScrapeDialog: React.FC = ({ // remove the tag from the list const newTagsClone = newTags.concat(); const pIndex = newTagsClone.indexOf(toCreate); + if (pIndex === -1) throw new Error("Could not find performer to remove"); newTagsClone.splice(pIndex, 1); setNewTags(newTagsClone); diff --git a/ui/v2.5/src/docs/en/Changelog/v0190.md b/ui/v2.5/src/docs/en/Changelog/v0190.md index 9a956bf69..a5b2530ff 100644 --- a/ui/v2.5/src/docs/en/Changelog/v0190.md +++ b/ui/v2.5/src/docs/en/Changelog/v0190.md @@ -9,6 +9,7 @@ * Changed performer aliases to be a list, rather than a string field. ([#3113](https://github.com/stashapp/stash/pull/3113)) ### 🐛 Bug fixes +* Fixed incorrect new Performer pill being removed when creating Performer from scrape dialog. ([#3251](https://github.com/stashapp/stash/pull/3251)) * Fixed date fields not being nulled correctly when cleared. ([#3243](https://github.com/stashapp/stash/pull/3243)) * Fixed scene wall items to show file base name where scene has no title set. ([#3242](https://github.com/stashapp/stash/pull/3242)) * Fixed image exclusion pattern being applied to all files. ([#3241](https://github.com/stashapp/stash/pull/3241))