UserInfo hide kick/mute buttons if they make no sense
							parent
							
								
									6e9791c950
								
							
						
					
					
						commit
						0497ef228d
					
				|  | @ -425,6 +425,9 @@ const useRoomPowerLevels = (cli, room) => { | |||
| const RoomKickButton = ({member, startUpdating, stopUpdating}) => { | ||||
|     const cli = useContext(MatrixClientContext); | ||||
| 
 | ||||
|     // check if user can be kicked/disinvited
 | ||||
|     if (member.membership !== "invite" && member.membership !== "join") return null; | ||||
| 
 | ||||
|     const onKick = async () => { | ||||
|         const ConfirmUserActionDialog = sdk.getComponent("dialogs.ConfirmUserActionDialog"); | ||||
|         const {finished} = Modal.createTrackedDialog( | ||||
|  | @ -602,6 +605,9 @@ const BanToggleButton = ({member, startUpdating, stopUpdating}) => { | |||
| const MuteToggleButton = ({member, room, powerLevels, startUpdating, stopUpdating}) => { | ||||
|     const cli = useContext(MatrixClientContext); | ||||
| 
 | ||||
|     // Don't show the mute/unmute option if the user is not in the room
 | ||||
|     if (member.membership !== "join") return null; | ||||
| 
 | ||||
|     const isMuted = _isMuted(member, powerLevels); | ||||
|     const onMuteToggle = async () => { | ||||
|         const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Michael Telatynski
						Michael Telatynski