@sawport/react-sdk 1.2.5-alpha.11 → 1.2.5-alpha.12

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
@@ -104802,7 +104802,7 @@ const VoiceRecording = memo(
104802
104802
  /* @__PURE__ */ jsx(
104803
104803
  Interval,
104804
104804
  {
104805
- Render: () => /* @__PURE__ */ jsx(Fragment, { children: hooks.utc((30 - recordingTime) * 1e3).format("HH:mm:ss") })
104805
+ Render: () => /* @__PURE__ */ jsx(Fragment, { children: hooks.utc(Math.max(0, 30 - recordingTime) * 1e3).format("HH:mm:ss") })
104806
104806
  }
104807
104807
  )
104808
104808
  ] }),
@@ -104965,7 +104965,7 @@ const Offline = memo(
104965
104965
  url: url3
104966
104966
  } = useAudioRecorder();
104967
104967
  useEffect(() => {
104968
- if (isRecording && 31 - recordingTime === 0) {
104968
+ if (isRecording && recordingTime >= 30) {
104969
104969
  stopRecording();
104970
104970
  }
104971
104971
  }, [recordingTime, isRecording]);
@@ -105143,7 +105143,7 @@ const Offline = memo(
105143
105143
  const removeInvitee = (email2) => {
105144
105144
  setInvitees((prev2) => prev2.filter((i2) => i2.email !== email2));
105145
105145
  };
105146
- return /* @__PURE__ */ jsxs("div", { className: "offline py-2 px-1 m-auto", children: [
105146
+ return /* @__PURE__ */ jsxs("div", { className: "offline pt-0 px-1 m-auto", children: [
105147
105147
  scheduled ? /* @__PURE__ */ jsx(
105148
105148
  Done$1,
105149
105149
  {
@@ -105698,6 +105698,11 @@ function WidgetInitForm({
105698
105698
  clearRecording,
105699
105699
  url: url3
105700
105700
  } = useAudioRecorder();
105701
+ useEffect(() => {
105702
+ if (isRecording && recordingTime >= 30) {
105703
+ stopRecording();
105704
+ }
105705
+ }, [isRecording, recordingTime, stopRecording]);
105701
105706
  const validSchema = useMemo$2(() => {
105702
105707
  const shape = {
105703
105708
  name: create$5().min(3).required(),
@@ -105970,7 +105975,7 @@ function WidgetInitForm({
105970
105975
  {
105971
105976
  type: "primary",
105972
105977
  htmlType: "submit",
105973
- disabled: state.isLoading || formik.values.reason === "Leave a voice note" && !recordingTime,
105978
+ disabled: state.isLoading || isRecording || formik.values.reason === "Leave a voice note" && !recordingTime,
105974
105979
  size: "large",
105975
105980
  className: "flex justify-center border-0 items-center w-full",
105976
105981
  style: { height: "48px", fontWeight: 600 },