Open space settings when editing a space topic (#34477)

SpaceRoomView renders RoomTopic for the space home view, but the Edit topic button in
the topic dialog dispatched open_room_settings unconditionally, so a space opened the
room settings dialog instead of its own.

Branch on room.isSpaceRoom() and use the existing showSpaceSettings() helper.
This commit is contained in:
hayyaksi
2026-08-04 17:36:17 +00:00
committed by GitHub
parent accfbc6f57
commit 74ac300f72
2 changed files with 67 additions and 1 deletions
@@ -22,6 +22,7 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext";
import AccessibleButton, { type ButtonEvent } from "./AccessibleButton";
import { topicToHtml } from "../../../HtmlUtils";
import { tryTransformPermalinkToLocalHref } from "../../../utils/permalinks/Permalinks";
import { showSpaceSettings } from "../../../utils/space";
interface IProps {
room: Room;
@@ -76,7 +77,13 @@ export default function RoomTopic({ room, className }: IProps): JSX.Element {
kind="primary_outline"
onClick={() => {
modal.close();
dis.dispatch({ action: "open_room_settings" });
// SpaceRoomView renders this component for spaces too, and a space
// has its own settings dialog.
if (room.isSpaceRoom()) {
showSpaceSettings(room);
} else {
dis.dispatch({ action: "open_room_settings" });
}
}}
>
{_t("room|edit_topic")}