Space panel should watch spaces for space name changes (#7432)
This commit is contained in:
parent
70dc03552c
commit
38634f86d1
3 changed files with 18 additions and 4 deletions
|
@ -174,6 +174,8 @@ const RoomListHeader = ({ spacePanelDisabled, onVisibilityChange }: IProps) => {
|
|||
}
|
||||
});
|
||||
|
||||
const spaceName = useEventEmitterState(activeSpace, "Room.name", () => activeSpace?.name);
|
||||
|
||||
useEffect(() => {
|
||||
if (onVisibilityChange) {
|
||||
onVisibilityChange();
|
||||
|
@ -320,7 +322,7 @@ const RoomListHeader = ({ spacePanelDisabled, onVisibilityChange }: IProps) => {
|
|||
|
||||
let title: string;
|
||||
if (activeSpace) {
|
||||
title = activeSpace.name;
|
||||
title = spaceName;
|
||||
} else if (communityId) {
|
||||
title = CommunityPrototypeStore.instance.getSelectedCommunityName();
|
||||
} else {
|
||||
|
@ -344,7 +346,7 @@ const RoomListHeader = ({ spacePanelDisabled, onVisibilityChange }: IProps) => {
|
|||
isExpanded={mainMenuDisplayed}
|
||||
className="mx_RoomListHeader_contextMenuButton"
|
||||
title={activeSpace
|
||||
? _t("%(spaceName)s menu", { spaceName: activeSpace.name })
|
||||
? _t("%(spaceName)s menu", { spaceName })
|
||||
: _t("Home options")}
|
||||
>
|
||||
{ title }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue