@pretty-chitty/core 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretty-chitty/core",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "A TypeScript framework for building high-quality async or realtime 3D strategy board games",
6
6
  "author": "Pretty Chitty, LLC",
@@ -21,7 +21,7 @@ export function InlineGalleryDisplay() {
21
21
  const [items, setItems] = useState<GalleryItem[] | undefined>(undefined);
22
22
  const [_source, setSource] = useEventChannelState(modalState.gallerySource);
23
23
  const [inlineSource, setInlineSource] = useEventChannelState(modalState.inlineGallerySource);
24
- const inlineGallerySize = inlineSource?.inlineGallerySize ?? DEFAULT_INLINE_GALLERY_SIZE;
24
+ const inlineGallerySize = inlineSource ? (inlineSource.inlineGallerySize ?? DEFAULT_INLINE_GALLERY_SIZE) : 0;
25
25
  const [displaySize, setDisplaySize] = useState(0);
26
26
  const [_galleryDisplayMode, setGalleryDisplayMode] = useButtonGalleriesOptions();
27
27
 
@@ -41,7 +41,7 @@ export function InlineGalleryDisplay() {
41
41
  }, [inlineSource, setItems, inlineGallerySize]);
42
42
 
43
43
  useEffect(() => {
44
- if (items && items.length > 0) {
44
+ if (items && items.length > 0 && inlineGallerySize > 0) {
45
45
  setDisplaySize(inlineGallerySize);
46
46
  } else {
47
47
  const to = setTimeout(() => {