if updating intermediate, dont add to gallery list cache

This commit is contained in:
Mary Hipp 2023-07-20 09:33:21 -04:00 committed by psychedelicious
parent f73c70ca96
commit ffe7d5785b

View File

@ -258,7 +258,12 @@ export const imagesApi = api.injectEndpoints({
*/
const patches: PatchCollection[] = [];
const { image_name, board_id, image_category } = oldImageDTO;
const { image_name, board_id, image_category, is_intermediate } = oldImageDTO;
const isChangingFromIntermediate = changes.is_intermediate === false;
// do not add intermediates to gallery cache
if (is_intermediate && !isChangingFromIntermediate) return;
const categories = IMAGE_CATEGORIES.includes(image_category)
? IMAGE_CATEGORIES
: ASSETS_CATEGORIES;