@rpg-engine/long-bow 0.5.67 → 0.5.68

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": "@rpg-engine/long-bow",
3
- "version": "0.5.67",
3
+ "version": "0.5.68",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -22,7 +22,7 @@ export const SimpleImageCarousel: React.FC<ISimpleImageCarousel> = ({
22
22
 
23
23
  const handleLeftClick = () => {
24
24
  setCurrentImage(
25
- prevImage => (prevImage - 1 + images.length) % images.length
25
+ prevImage => (prevImage - 1 + images?.length) % images?.length
26
26
  );
27
27
  if (stopAutoCyclingOnInteraction && autoCycleId) {
28
28
  clearInterval(autoCycleId);
@@ -31,7 +31,7 @@ export const SimpleImageCarousel: React.FC<ISimpleImageCarousel> = ({
31
31
  };
32
32
 
33
33
  const handleRightClick = () => {
34
- setCurrentImage(prevImage => (prevImage + 1) % images.length);
34
+ setCurrentImage(prevImage => (prevImage + 1) % images?.length);
35
35
  if (stopAutoCyclingOnInteraction && autoCycleId) {
36
36
  clearInterval(autoCycleId);
37
37
  setAutoCycleId(null);
@@ -41,7 +41,7 @@ export const SimpleImageCarousel: React.FC<ISimpleImageCarousel> = ({
41
41
  useEffect(() => {
42
42
  if (autoCycle) {
43
43
  const id = setInterval(() => {
44
- setCurrentImage(prevImage => (prevImage + 1) % images.length);
44
+ setCurrentImage(prevImage => (prevImage + 1) % images?.length);
45
45
  }, autoCycleDelay);
46
46
  setAutoCycleId(id);
47
47
  }
@@ -51,9 +51,9 @@ export const SimpleImageCarousel: React.FC<ISimpleImageCarousel> = ({
51
51
  clearInterval(autoCycleId);
52
52
  }
53
53
  };
54
- }, [autoCycle, autoCycleDelay, images.length]);
54
+ }, [autoCycle, autoCycleDelay, images?.length]);
55
55
 
56
- const hasMoreThanOneImage = images.length > 1;
56
+ const hasMoreThanOneImage = images?.length > 1;
57
57
 
58
58
  return (
59
59
  <ImageContainer style={styles}>
@@ -66,7 +66,7 @@ export const SimpleImageCarousel: React.FC<ISimpleImageCarousel> = ({
66
66
  <Carousel>
67
67
  <FadeInCarouselImg
68
68
  key={currentImage}
69
- src={images[currentImage]}
69
+ src={images?.[currentImage]}
70
70
  alt={`Image ${currentImage}`}
71
71
  />
72
72
  </Carousel>