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 and toger5 committed Nov 10, 2021
1 parent f4ada31 commit 09a0ffb
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 09a0ffb

Please sign in to comment.