@assistant-ui/react 0.3.3 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -529,9 +529,10 @@ var useActionBarCopy = ({
529
529
  const { setIsCopied } = useMessageUtils.getState();
530
530
  const { isEditing, value: composerValue } = useEditComposer.getState();
531
531
  const valueToCopy = isEditing ? composerValue : getMessageText(message);
532
- navigator.clipboard.writeText(valueToCopy);
533
- setIsCopied(true);
534
- setTimeout(() => setIsCopied(false), copiedDuration);
532
+ navigator.clipboard.writeText(valueToCopy).then(() => {
533
+ setIsCopied(true);
534
+ setTimeout(() => setIsCopied(false), copiedDuration);
535
+ });
535
536
  }, [useMessage, useMessageUtils, useEditComposer, copiedDuration]);
536
537
  if (!hasCopyableContent) return null;
537
538
  return callback;
@@ -1217,7 +1218,6 @@ var useSmooth = (text, smooth = false) => {
1217
1218
  new TextStreamAnimator(setDisplayedText)
1218
1219
  );
1219
1220
  useEffect8(() => {
1220
- console.log("smooth", smooth);
1221
1221
  if (!smooth) {
1222
1222
  animatorRef.stop();
1223
1223
  return;
@@ -1230,7 +1230,6 @@ var useSmooth = (text, smooth = false) => {
1230
1230
  }
1231
1231
  animatorRef.targetText = text;
1232
1232
  animatorRef.start();
1233
- console.log("animating");
1234
1233
  }, [animatorRef, smooth, text]);
1235
1234
  useEffect8(() => {
1236
1235
  return () => {