Fix slightly noisy warning when switching spaces (#9468)

Sometimes `spaceName` can be `undefined` because of function timing - use a different method for getting the space's name when this happens.
This commit is contained in:
Travis Ralston 2022-10-20 00:52:06 -06:00 committed by GitHub
parent 17c3fb89c1
commit dade38086c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -379,7 +379,7 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
isExpanded={mainMenuDisplayed}
className="mx_RoomListHeader_contextMenuButton"
title={activeSpace
? _t("%(spaceName)s menu", { spaceName })
? _t("%(spaceName)s menu", { spaceName: spaceName ?? activeSpace.name })
: _t("Home options")}
>
{ title }