diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 3ac4088182..829710185d 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -535,6 +535,8 @@ interface IBaseProps { const RoomKickButton: React.FC = ({ member, startUpdating, stopUpdating }) => { const cli = useContext(MatrixClientContext); + // don't render this button on our own profile, we don't want to kick ourselves + if (member.userId === cli.getUserId()) return null; // check if user can be kicked/disinvited if (member.membership !== "invite" && member.membership !== "join") return null; @@ -659,6 +661,9 @@ const RedactMessagesButton: React.FC = ({ member }) => { const BanToggleButton: React.FC = ({ member, startUpdating, stopUpdating }) => { const cli = useContext(MatrixClientContext); + // don't render this button on our own profile, we don't want to ban ourselves and can't unban ourselves anyhow + if (member.userId === cli.getUserId()) return null; + const onBanOrUnban = async () => { const { finished } = Modal.createTrackedDialog( 'Confirm User Action Dialog',