From d62aa65fb3749d9b896fe8154bf9adf1965a4c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Tue, 10 Oct 2023 13:51:00 +0200 Subject: [PATCH] Fix PictureSequenceInfoField sometimes showing no pictures 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' />