Fix incorrect gallery when clicking queue item (#2897)

This commit is contained in:
WithoutPants 2022-09-14 14:21:30 +10:00 committed by GitHub
parent df9c7594c7
commit 5db42f4882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -64,10 +64,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
const intl = useIntl();
const Toast = useToast();
const [galleries, setGalleries] = useState<{ id: string; title: string }[]>(
scene.galleries.map((g) => ({
id: g.id,
title: objectTitle(g),
}))
[]
);
const Scrapers = useListSceneScrapers();
@ -90,6 +87,15 @@ export const SceneEditPanel: React.FC<IProps> = ({
setCoverImagePreview(scene.paths.screenshot ?? undefined);
}, [scene.paths.screenshot]);
useEffect(() => {
setGalleries(
scene.galleries.map((g) => ({
id: g.id,
title: objectTitle(g),
}))
);
}, [scene.galleries]);
const { configuration: stashConfig } = React.useContext(ConfigurationContext);
// Network state