mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Fix setting scene gallery (#1484)
This commit is contained in:
@@ -126,6 +126,19 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||||||
formik.setFieldValue("rating", v);
|
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(() => {
|
useEffect(() => {
|
||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
Mousetrap.bind("s s", () => {
|
Mousetrap.bind("s s", () => {
|
||||||
@@ -604,7 +617,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||||||
<Col xs={9}>
|
<Col xs={9}>
|
||||||
<GallerySelect
|
<GallerySelect
|
||||||
galleries={galleries}
|
galleries={galleries}
|
||||||
onSelect={(items) => setGalleries(items)}
|
onSelect={(items) => onSetGalleries(items)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|||||||
Reference in New Issue
Block a user