mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Fix entity creation bug during tag/performer scraping (#2004)
This commit is contained in:
@@ -405,12 +405,12 @@ export const SceneScrapeDialog: React.FC<ISceneScrapeDialogProps> = ({
|
|||||||
variables: { input },
|
variables: { input },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const newValue = [...(performers.newValue ?? [])];
|
||||||
|
if (result.data?.performerCreate)
|
||||||
|
newValue.push(result.data.performerCreate.id);
|
||||||
|
|
||||||
// add the new performer to the new performers value
|
// add the new performer to the new performers value
|
||||||
const performerClone = performers.cloneWithValue(performers.newValue);
|
const performerClone = performers.cloneWithValue(newValue);
|
||||||
if (!performerClone.newValue) {
|
|
||||||
performerClone.newValue = [];
|
|
||||||
}
|
|
||||||
performerClone.newValue.push(result.data!.performerCreate!.id);
|
|
||||||
setPerformers(performerClone);
|
setPerformers(performerClone);
|
||||||
|
|
||||||
// remove the performer from the list
|
// remove the performer from the list
|
||||||
@@ -490,12 +490,11 @@ export const SceneScrapeDialog: React.FC<ISceneScrapeDialogProps> = ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const newValue = [...(tags.newValue ?? [])];
|
||||||
|
if (result.data?.tagCreate) newValue.push(result.data.tagCreate.id);
|
||||||
|
|
||||||
// add the new tag to the new tags value
|
// add the new tag to the new tags value
|
||||||
const tagClone = tags.cloneWithValue(tags.newValue);
|
const tagClone = tags.cloneWithValue(newValue);
|
||||||
if (!tagClone.newValue) {
|
|
||||||
tagClone.newValue = [];
|
|
||||||
}
|
|
||||||
tagClone.newValue.push(result.data!.tagCreate!.id);
|
|
||||||
setTags(tagClone);
|
setTags(tagClone);
|
||||||
|
|
||||||
// remove the tag from the list
|
// remove the tag from the list
|
||||||
|
|||||||
Reference in New Issue
Block a user