Fix incorrect performer removed after creation (#3251)

This commit is contained in:
WithoutPants
2022-12-08 19:08:29 +11:00
committed by GitHub
parent 782bed9df8
commit 2064ea27b0
2 changed files with 8 additions and 1 deletions

View File

@@ -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);

View File

@@ -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))