mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-10 09:10:29 +03:00
Automatic update people list
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
8711658e75
commit
6fdace07c8
2 changed files with 22 additions and 11 deletions
|
|
@ -92,6 +92,9 @@ function ProfileFooter({ roomId, userId, onRequestClose }) {
|
|||
const [isInviting, setIsInviting] = useState(false);
|
||||
const [isInvited, setIsInvited] = useState(member?.membership === 'invite');
|
||||
|
||||
const myPowerlevel = room.getMember(mx.getUserId()).powerLevel;
|
||||
const canIKick = room.currentState.hasSufficientPowerLevelFor('kick', myPowerlevel);
|
||||
|
||||
useEffect(() => () => {
|
||||
isMountedRef.current = false;
|
||||
}, []);
|
||||
|
|
@ -180,8 +183,11 @@ function ProfileFooter({ roomId, userId, onRequestClose }) {
|
|||
{isCreatingDM ? 'Creating room...' : 'Message'}
|
||||
</Button>
|
||||
{ member?.membership === 'join' && <Button>Mention</Button>}
|
||||
{room.canInvite(mx.getUserId()) && isInvitable && (
|
||||
<Button onClick={toggleInvite}>
|
||||
{ (isInvited ? canIKick : room.canInvite(mx.getUserId())) && isInvitable && (
|
||||
<Button
|
||||
onClick={toggleInvite}
|
||||
disabled={isInviting}
|
||||
>
|
||||
{
|
||||
isInvited
|
||||
? `${isInviting ? 'Disinviting...' : 'Disinvite'}`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue