mirror of
https://github.com/stashapp/stash.git
synced 2025-12-15 21:03:22 +01:00
Fix setting scene gallery (#1484)
This commit is contained in:
parent
c53799c25b
commit
3e80dffe34
1 changed files with 14 additions and 1 deletions
|
|
@ -126,6 +126,19 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||
formik.setFieldValue("rating", v);
|
||||
}
|
||||
|
||||
interface IGallerySelectValue {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
function onSetGalleries(items: IGallerySelectValue[]) {
|
||||
setGalleries(items);
|
||||
formik.setFieldValue(
|
||||
"gallery_ids",
|
||||
items.map((i) => i.id)
|
||||
);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (isVisible) {
|
||||
Mousetrap.bind("s s", () => {
|
||||
|
|
@ -604,7 +617,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||
<Col xs={9}>
|
||||
<GallerySelect
|
||||
galleries={galleries}
|
||||
onSelect={(items) => setGalleries(items)}
|
||||
onSelect={(items) => onSetGalleries(items)}
|
||||
/>
|
||||
</Col>
|
||||
</Form.Group>
|
||||
|
|
|
|||
Loading…
Reference in a new issue