diff --git a/web/chat/relationship-prompt/relationship-prompt-button.js b/web/chat/relationship-prompt/relationship-prompt-button.js
--- a/web/chat/relationship-prompt/relationship-prompt-button.js
+++ b/web/chat/relationship-prompt/relationship-prompt-button.js
@@ -13,10 +13,11 @@
+icon: IconDefinition,
+buttonColor: ButtonColor,
+onClick: () => void,
+ +isLoading: boolean,
+className?: string,
};
function RelationshipPromptButton(props: Props): React.Node {
- const { text, icon, buttonColor, onClick, className } = props;
+ const { text, icon, buttonColor, onClick, isLoading, className } = props;
const buttonClassName = classnames(css.promptButton, className);
@@ -27,12 +28,13 @@
buttonColor={buttonColor}
onClick={onClick}
className={buttonClassName}
+ disabled={isLoading}
>
{text}
), - [buttonClassName, buttonColor, icon, onClick, text], + [buttonClassName, buttonColor, icon, isLoading, onClick, text], ); return relationshipPromptButton; diff --git a/web/chat/relationship-prompt/relationship-prompt.js b/web/chat/relationship-prompt/relationship-prompt.js --- a/web/chat/relationship-prompt/relationship-prompt.js +++ b/web/chat/relationship-prompt/relationship-prompt.js @@ -26,6 +26,12 @@ const { otherUserInfo, callbacks: { blockUser, unblockUser, friendUser, unfriendUser }, + loadingState: { + isLoadingBlockUser, + isLoadingUnblockUser, + isLoadingFriendUser, + isLoadingUnfriendUser, + }, } = useRelationshipPrompt( threadInfo, undefined, @@ -42,10 +48,11 @@ return (