@assistant-ui/react 0.3.4 → 0.3.5

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.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;