reachat 2.1.0-alpha.20 → 2.1.0-alpha.21

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
@@ -10,7 +10,7 @@
10
10
  console.error("vite-plugin-css-injected-by-js", e);
11
11
  }
12
12
  })();
13
- import { A, b, c, C, d, e, F, M, j, k, m, n, o, p, q, N, i, w, x, s, t, u, v, y, z, T, g, f, B, h, D, l, r } from "./index-DNefh8rs.js";
13
+ import { A, b, c, C, d, e, F, M, j, k, m, n, o, p, q, N, i, w, x, s, t, u, v, y, z, T, g, f, B, h, D, l, r } from "./index-CwH75cwk.js";
14
14
  import "react/jsx-runtime";
15
15
  import "motion/react";
16
16
  import "reablocks";
@@ -1953,11 +1953,15 @@ ${response}`),
1953
1953
  const ref = React.useRef(null);
1954
1954
  const calculateTruncation = React.useCallback(() => {
1955
1955
  const el = ref.current;
1956
- setTruncated(el.scrollHeight > el.clientHeight);
1956
+ if (el) {
1957
+ setTruncated(el.scrollHeight > el.clientHeight);
1958
+ }
1957
1959
  }, []);
1958
1960
  React.useEffect(() => {
1959
1961
  const el = ref.current;
1960
- if (!el || previewLineClamp === false) return;
1962
+ if (!el || previewLineClamp === false) {
1963
+ return;
1964
+ }
1961
1965
  calculateTruncation();
1962
1966
  const resizeObserver = new ResizeObserver(() => {
1963
1967
  calculateTruncation();