Fix bug 66831 - Rooms: Invite via link: Request failed with status code 403

This commit is contained in:
Alexey Safronov 2024-08-12 15:21:29 +04:00
parent e3f153b04a
commit a99de259cf

View File

@ -66,11 +66,18 @@ const ExternalLinks = ({
isMobileView,
getPortalInviteLink,
}) => {
const [isLinksToggling, setIsLinksToggling] = useState(false);
const [actionLinksVisible, setActionLinksVisible] = useState(false);
const inputsRef = useRef();
const toggleLinks = async (e) => {
if (isLinksToggling) return;
setIsLinksToggling(true);
try {
if (roomId === -1) {
if (e?.target?.checked) {
const link = shareLinks.find((l) => l.access === defaultAccess);
@ -83,8 +90,12 @@ const ExternalLinks = ({
} else {
!externalLinksVisible ? editLink() : disableLink();
}
onChangeExternalLinksVisible(!externalLinksVisible);
} catch (error) {
toastr.error(error.message);
} finally {
setIsLinksToggling(false);
}
};
const disableLink = () => {
@ -223,6 +234,7 @@ const ExternalLinks = ({
className="invite-via-link"
isChecked={externalLinksVisible}
onChange={toggleLinks}
isDisabled={isLinksToggling}
/>
</StyledSubHeader>
<StyledDescription>