@ikatec/nebula-react 1.3.0-beta.3 → 1.3.1-beta.1

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 CHANGED
@@ -6105,7 +6105,9 @@ var ProfileImage = ({
6105
6105
  handleFileChange(file2?.file);
6106
6106
  }
6107
6107
  });
6108
- const [finalImageUrl, setFinalImageUrl] = React8.useState(null);
6108
+ const [finalImageUrl, setFinalImageUrl] = React8.useState(
6109
+ image || null
6110
+ );
6109
6111
  const [isDialogOpen, setIsDialogOpen] = React8.useState(false);
6110
6112
  React8.useEffect(() => {
6111
6113
  onError?.(errors);
@@ -6118,12 +6120,14 @@ var ProfileImage = ({
6118
6120
  if (withCropper) return finalImageUrl;
6119
6121
  return previewUrl;
6120
6122
  }, [previewUrl, withCropper, finalImageUrl]);
6123
+ const initialRenderRef = React8.useRef(true);
6121
6124
  React8.useEffect(() => {
6122
6125
  if (!withCropper) return;
6123
- if (fileId && fileId !== previousFileIdRef.current) {
6126
+ if (fileId && fileId !== previousFileIdRef.current && !initialRenderRef.current) {
6124
6127
  setIsDialogOpen(true);
6125
6128
  }
6126
6129
  previousFileIdRef.current = fileId;
6130
+ initialRenderRef.current = false;
6127
6131
  }, [fileId, withCropper]);
6128
6132
  const handleApply = async (croppedUrl, croppedBlob) => {
6129
6133
  try {
package/dist/index.mjs CHANGED
@@ -6063,7 +6063,9 @@ var ProfileImage = ({
6063
6063
  handleFileChange(file2?.file);
6064
6064
  }
6065
6065
  });
6066
- const [finalImageUrl, setFinalImageUrl] = useState(null);
6066
+ const [finalImageUrl, setFinalImageUrl] = useState(
6067
+ image || null
6068
+ );
6067
6069
  const [isDialogOpen, setIsDialogOpen] = useState(false);
6068
6070
  useEffect(() => {
6069
6071
  onError?.(errors);
@@ -6076,12 +6078,14 @@ var ProfileImage = ({
6076
6078
  if (withCropper) return finalImageUrl;
6077
6079
  return previewUrl;
6078
6080
  }, [previewUrl, withCropper, finalImageUrl]);
6081
+ const initialRenderRef = useRef(true);
6079
6082
  useEffect(() => {
6080
6083
  if (!withCropper) return;
6081
- if (fileId && fileId !== previousFileIdRef.current) {
6084
+ if (fileId && fileId !== previousFileIdRef.current && !initialRenderRef.current) {
6082
6085
  setIsDialogOpen(true);
6083
6086
  }
6084
6087
  previousFileIdRef.current = fileId;
6088
+ initialRenderRef.current = false;
6085
6089
  }, [fileId, withCropper]);
6086
6090
  const handleApply = async (croppedUrl, croppedBlob) => {
6087
6091
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikatec/nebula-react",
3
- "version": "1.3.0-beta.3",
3
+ "version": "1.3.1-beta.1",
4
4
  "description": "React components for Nebula Design System",
5
5
  "publishConfig": {
6
6
  "access": "public"