Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Update powerlevel/role when the user changes in the user info panel (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBrandner authored Nov 9, 2021
1 parent 06e1f8c commit 6cae176
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,10 @@ const PowerLevelEditor: React.FC<{
const cli = useContext(MatrixClientContext);

const [selectedPowerLevel, setSelectedPowerLevel] = useState(user.powerLevel);
useEffect(() => {
setSelectedPowerLevel(user.powerLevel);
}, [user]);

const onPowerChange = useCallback(async (powerLevel: number) => {
setSelectedPowerLevel(powerLevel);

Expand Down

0 comments on commit 6cae176

Please sign in to comment.