From 8139bd5e66b41750825af796d78aaa002597f386 Mon Sep 17 00:00:00 2001 From: MariusDoe <41512063+MariusDoe@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:33:20 +0200 Subject: [PATCH] Fix PictureSequenceInfoField sometimes showing no pictures (#646) Before, when switching between two pictures, where the first is part of a sequence, the the other pictures in the sequence are not shown when switching back to the first. The exact reason is unclear, however print debugging has shown that during switching, the correct array of pictures is displayed first, only to be replaced by an empty array shortly after. Since this commit fixes the issue by changing the fetchPolicy from 'cache-first' (default) to 'cache-and-network', the problem is likely related to Apollo's caching behavior. --- .../picture/sidebar/picture-info/PictureSequenceInfoField.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/bp-gallery/src/components/views/picture/sidebar/picture-info/PictureSequenceInfoField.tsx b/projects/bp-gallery/src/components/views/picture/sidebar/picture-info/PictureSequenceInfoField.tsx index a5fe367a1..1f9df088e 100644 --- a/projects/bp-gallery/src/components/views/picture/sidebar/picture-info/PictureSequenceInfoField.tsx +++ b/projects/bp-gallery/src/components/views/picture/sidebar/picture-info/PictureSequenceInfoField.tsx @@ -85,6 +85,7 @@ const PictureSequenceInfoField = ({ picture }: { picture: FlatPicture }) => { textFilter={TextFilter.PICTURES_AND_TEXTS} cacheOnRefetch onSort={canEdit ? onSort : undefined} + fetchPolicy='cache-and-network' />