@assistant-ui/react 0.5.50 → 0.5.51

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -2869,9 +2869,9 @@ var createActionButton = (displayName, useActionButton, forwardProps = []) => {
2869
2869
  Primitive3.button,
2870
2870
  {
2871
2871
  type: "button",
2872
- disabled: !callback,
2873
2872
  ...primitiveProps,
2874
2873
  ref: forwardedRef,
2874
+ disabled: primitiveProps.disabled || !callback,
2875
2875
  onClick: composeEventHandlers(primitiveProps.onClick, () => {
2876
2876
  callback?.();
2877
2877
  })
@@ -4049,6 +4049,8 @@ var useMessageContext2 = (messageIndex) => {
4049
4049
  throw new Error(
4050
4050
  "Tried to edit a non-user message. Editing is only supported for user messages. This is likely an internal bug in assistant-ui."
4051
4051
  );
4052
+ const previousText = getThreadMessageText(message);
4053
+ if (previousText === text) return;
4052
4054
  const nonTextParts = message.content.filter(
4053
4055
  (part) => part.type !== "text" && part.type !== "ui"
4054
4056
  );