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

pull/21833/head
Šimon Brandner 2021-11-09 10:25:47 +01:00 committed by GitHub
parent 06e1f8ce85
commit 6cae176857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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);