Client: Added role change for free user.

This commit is contained in:
Tatiana Lopaeva 2024-08-16 13:22:02 +03:00
parent a6f87e19c7
commit 91b3212529

View File

@ -309,6 +309,14 @@ const InviteInput = ({
});
}
if (isPaidUserLimit && item.isVisitor && isPaidUserRole(item.access)) {
const freeRole = getTopFreeRole(t, roomType)?.access;
if (freeRole) {
item.access = freeRole;
toastr.error(<PaidQuotaLimitError />);
}
}
const items = removeExist([item, ...inviteItems]);
setInviteItems(items);
}
@ -370,7 +378,11 @@ const InviteInput = ({
});
}
if (isPaidUserLimit && !u.avatar && isPaidUserRole(u.access)) {
if (
isPaidUserLimit &&
(!u.avatar || u.isVisitor) &&
isPaidUserRole(u.access)
) {
const freeRole = getTopFreeRole(t, roomType)?.access;
if (freeRole) {