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

Update powerlevel/role when the user changes in the user info panel #7099

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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