@chao-component/bag-animation-ui 1.0.18 → 1.0.20
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/dist/index.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -845,7 +845,9 @@ function BagAnimation({
|
|
|
845
845
|
}
|
|
846
846
|
}, [isAnimating]);
|
|
847
847
|
(0, import_react.useEffect)(() => {
|
|
848
|
-
if (!isAnimating || !canvasRef.current || !hasChances)
|
|
848
|
+
if (!isAnimating || !canvasRef.current || !hasChances) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
849
851
|
const canvas = canvasRef.current;
|
|
850
852
|
const ctx = canvas.getContext("2d");
|
|
851
853
|
if (!ctx) return;
|
|
@@ -940,7 +942,7 @@ function BagAnimation({
|
|
|
940
942
|
animationRefs.current[frame].stop();
|
|
941
943
|
}
|
|
942
944
|
};
|
|
943
|
-
}, [frame, isAnimating,
|
|
945
|
+
}, [frame, isAnimating, doneFunction]);
|
|
944
946
|
(0, import_react.useEffect)(() => {
|
|
945
947
|
if (isPausedAtThird && thirdFrameCtxRef.current && thirdFrameApngRef.current && thirdFramePlayerRef.current && canvasRef.current && thirdFrameOriginalSizeRef.current) {
|
|
946
948
|
const apng = thirdFrameApngRef.current;
|
package/dist/index.mjs
CHANGED
|
@@ -829,7 +829,9 @@ function BagAnimation({
|
|
|
829
829
|
}
|
|
830
830
|
}, [isAnimating]);
|
|
831
831
|
useEffect(() => {
|
|
832
|
-
if (!isAnimating || !canvasRef.current || !hasChances)
|
|
832
|
+
if (!isAnimating || !canvasRef.current || !hasChances) {
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
833
835
|
const canvas = canvasRef.current;
|
|
834
836
|
const ctx = canvas.getContext("2d");
|
|
835
837
|
if (!ctx) return;
|
|
@@ -924,7 +926,7 @@ function BagAnimation({
|
|
|
924
926
|
animationRefs.current[frame].stop();
|
|
925
927
|
}
|
|
926
928
|
};
|
|
927
|
-
}, [frame, isAnimating,
|
|
929
|
+
}, [frame, isAnimating, doneFunction]);
|
|
928
930
|
useEffect(() => {
|
|
929
931
|
if (isPausedAtThird && thirdFrameCtxRef.current && thirdFrameApngRef.current && thirdFramePlayerRef.current && canvasRef.current && thirdFrameOriginalSizeRef.current) {
|
|
930
932
|
const apng = thirdFrameApngRef.current;
|