Skip to content

Commit

Permalink
chore: sync compoments
Browse files Browse the repository at this point in the history
  • Loading branch information
ifaouibadi committed Mar 26, 2024
1 parent b71ac8d commit cab4dd1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ const MuteToggleButton: React.FC<IBaseRoomProps> = ({
return;
}

cli.setPowerLevel(roomId, target, level, powerLevelEvent)
cli.setPowerLevel(roomId, target, level)
.then(
() => {
// NO-OP; rely on the m.room.member event coming down else we could
Expand Down Expand Up @@ -1123,13 +1123,8 @@ export const PowerLevelEditor: React.FC<{
async (powerLevel: number) => {
setSelectedPowerLevel(powerLevel);

const applyPowerChange = (
roomId: string,
target: string,
powerLevel: number,
powerLevelEvent: MatrixEvent,
): Promise<unknown> => {
return cli.setPowerLevel(roomId, target, powerLevel, powerLevelEvent).then(
const applyPowerChange = (roomId: string, target: string, powerLevel: number): Promise<unknown> => {
return cli.setPowerLevel(roomId, target, powerLevel).then(
function () {
// NO-OP; rely on the m.room.member event coming down else we could
// get out of sync if we force setState here!
Expand Down Expand Up @@ -1177,7 +1172,7 @@ export const PowerLevelEditor: React.FC<{
}
}

await applyPowerChange(roomId, target, powerLevel, powerLevelEvent);
await applyPowerChange(roomId, target, powerLevel);
},
[user.roomId, user.userId, cli, room],
);
Expand Down
15 changes: 15 additions & 0 deletions src/components/views/spaces/SpacePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,20 @@ const OrphansButton: React.FC<MetaSpaceButtonProps> = ({ selected, isPanelCollap
);
};

const VideoRoomsButton: React.FC<MetaSpaceButtonProps> = ({ selected, isPanelCollapsed }) => {
return (
<MetaSpaceButton
spaceKey={MetaSpace.VideoRooms}
className="mx_SpaceButton_videoRooms"
selected={selected}
isPanelCollapsed={isPanelCollapsed}
label={getMetaSpaceName(MetaSpace.VideoRooms)}
notificationState={SpaceStore.instance.getNotificationState(MetaSpace.VideoRooms)}
size="32px"
/>
);
};

const CreateSpaceButton: React.FC<Pick<IInnerSpacePanelProps, "isPanelCollapsed" | "setPanelCollapsed">> = ({
isPanelCollapsed,
setPanelCollapsed,
Expand Down Expand Up @@ -264,6 +278,7 @@ const metaSpaceComponentMap: Record<MetaSpace, typeof HomeButton> = {
[MetaSpace.Favourites]: FavouritesButton,
[MetaSpace.People]: PeopleButton,
[MetaSpace.Orphans]: OrphansButton,
[MetaSpace.VideoRooms]: VideoRoomsButton,
};

interface IInnerSpacePanelProps extends DroppableProvidedProps {
Expand Down

0 comments on commit cab4dd1

Please sign in to comment.