@assistant-ui/react 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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
|
-
|
534
|
-
|
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;
|