diff --git a/src/components/views/rooms/RoomBreadcrumbs2.tsx b/src/components/views/rooms/RoomBreadcrumbs2.tsx index 687f4dd73e..f08adebcd2 100644 --- a/src/components/views/rooms/RoomBreadcrumbs2.tsx +++ b/src/components/views/rooms/RoomBreadcrumbs2.tsx @@ -16,7 +16,6 @@ limitations under the License. import React from "react"; import { BreadcrumbsStore } from "../../../stores/BreadcrumbsStore"; -import AccessibleButton from "../elements/AccessibleButton"; import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar"; import { _t } from "../../../languageHandler"; import { Room } from "matrix-js-sdk/src/models/room"; @@ -88,16 +87,19 @@ export default class RoomBreadcrumbs2 extends React.PureComponent { Analytics.trackEvent("Breadcrumbs", "click_node", index); - defaultDispatcher.dispatch({action: "view_room", room_id: room.roomId}); + // If we're rendering the first breadcrumb and this is it no-op + if (!this.state.skipFirst && index === 0) { + return; + } else { + defaultDispatcher.dispatch({action: "view_room", room_id: room.roomId}); + } }; public render(): React.ReactElement { - // TODO: Decorate crumbs with icons: https://github.com/vector-im/riot-web/issues/14040 - // TODO: Scrolling: https://github.com/vector-im/riot-web/issues/14040 - // TODO: Tooltips: https://github.com/vector-im/riot-web/issues/14040 const tiles = BreadcrumbsStore.instance.rooms.map((r, i) => { const roomTags = RoomListStore.instance.getTagsForRoom(r); const roomTag = roomTags.includes(DefaultTagID.DM) ? DefaultTagID.DM : roomTags[0]; + const anon = () => this.viewRoom(r, i); return (