mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Fix incorrect performer removed after creation (#3251)
This commit is contained in:
@@ -470,7 +470,11 @@ export const SceneScrapeDialog: React.FC<ISceneScrapeDialogProps> = ({
|
||||
|
||||
// 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<ISceneScrapeDialogProps> = ({
|
||||
// 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<ISceneScrapeDialogProps> = ({
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user