diff --git a/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx b/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx index c5efe10e0f..fcc269bede 100644 --- a/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx +++ b/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx @@ -17,7 +17,7 @@ import { Icon as ExternalLinkIcon } from "@vector-im/compound-design-tokens/icon import { Button, IconButton, Tooltip } from "@vector-im/compound-web"; import React, { useCallback } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { EventType, IJoinRuleEventContent, JoinRule, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, JoinRule, Room } from "matrix-js-sdk/src/matrix"; import Modal from "../../../../Modal"; import ShareDialog from "../../dialogs/ShareDialog"; @@ -118,7 +118,7 @@ export const JoinRuleDialog: React.FC<{ EventType.RoomJoinRules, { join_rule: newRule, - } as IJoinRuleEventContent, + }, "", ); // Show the dialog for a bit to give the user feedback diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index bbb3154f12..472cb4e4eb 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -15,16 +15,8 @@ limitations under the License. */ import React, { ChangeEvent, ReactNode } from "react"; -import { - Room, - RoomMember, - EventType, - RoomType, - IJoinRuleEventContent, - JoinRule, - MatrixError, -} from "matrix-js-sdk/src/matrix"; -import { KnownMembership } from "matrix-js-sdk/src/types"; +import { Room, RoomMember, EventType, RoomType, JoinRule, MatrixError } from "matrix-js-sdk/src/matrix"; +import { KnownMembership, RoomJoinRulesEventContent } from "matrix-js-sdk/src/types"; import classNames from "classnames"; import { RoomPreviewOpts, RoomViewLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; @@ -257,7 +249,7 @@ export default class RoomPreviewBar extends React.Component { return ( this.props.room?.currentState .getStateEvents(EventType.RoomJoinRules, "") - ?.getContent().join_rule ?? null + ?.getContent().join_rule ?? null ); } diff --git a/src/components/views/settings/JoinRuleSettings.tsx b/src/components/views/settings/JoinRuleSettings.tsx index 9f4bceb02a..0d7cac30d7 100644 --- a/src/components/views/settings/JoinRuleSettings.tsx +++ b/src/components/views/settings/JoinRuleSettings.tsx @@ -15,14 +15,8 @@ limitations under the License. */ import React, { ReactNode, useEffect, useState } from "react"; -import { - IJoinRuleEventContent, - JoinRule, - RestrictedAllowType, - Room, - EventType, - Visibility, -} from "matrix-js-sdk/src/matrix"; +import { JoinRule, RestrictedAllowType, Room, EventType, Visibility } from "matrix-js-sdk/src/matrix"; +import { RoomJoinRulesEventContent } from "matrix-js-sdk/src/types"; import StyledRadioGroup, { IDefinition } from "../elements/StyledRadioGroup"; import { _t } from "../../../languageHandler"; @@ -72,7 +66,7 @@ const JoinRuleSettings: React.FC = ({ const disabled = !room.currentState.mayClientSendStateEvent(EventType.RoomJoinRules, cli); - const [content, setContent] = useLocalEcho( + const [content, setContent] = useLocalEcho( () => room.currentState.getStateEvents(EventType.RoomJoinRules, "")?.getContent(), (content) => cli.sendStateEvent(room.roomId, EventType.RoomJoinRules, content, ""), onError, @@ -391,7 +385,7 @@ const JoinRuleSettings: React.FC = ({ if (beforeJoinRule === joinRule && !restrictedAllowRoomIds) return; if (beforeChange && !(await beforeChange(joinRule))) return; - const newContent: IJoinRuleEventContent = { + const newContent: RoomJoinRulesEventContent = { join_rule: joinRule, };