Use EventType at the state and account data call sites. [skip build]
This commit is contained in:
@@ -3,7 +3,7 @@ import React, { FormEventHandler, useCallback, useMemo, useState } from 'react';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import Linkify from 'linkify-react';
|
||||
import classNames from 'classnames';
|
||||
import { JoinRule, MatrixError } from 'matrix-js-sdk';
|
||||
import { EventType, JoinRule, MatrixError } from 'matrix-js-sdk';
|
||||
import { Icon, Icons } from '../../../components/icons';
|
||||
import { SequenceCard } from '../../../components/sequence-card';
|
||||
import { SequenceCardStyle } from '../../room-settings/styles.css';
|
||||
@@ -82,15 +82,16 @@ export function RoomProfileEdit({
|
||||
useCallback(
|
||||
async (roomAvatarMxc?: string | null, roomName?: string, roomTopic?: string) => {
|
||||
if (roomAvatarMxc !== undefined) {
|
||||
await mx.sendStateEvent(room.roomId, StateEvent.RoomAvatar as any, {
|
||||
url: roomAvatarMxc,
|
||||
// url can be null to clear the avatar, which RoomAvatarEventContent does not allow
|
||||
await mx.sendStateEvent(room.roomId, EventType.RoomAvatar, {
|
||||
url: roomAvatarMxc as any,
|
||||
});
|
||||
}
|
||||
if (roomName !== undefined) {
|
||||
await mx.sendStateEvent(room.roomId, StateEvent.RoomName as any, { name: roomName });
|
||||
await mx.sendStateEvent(room.roomId, EventType.RoomName, { name: roomName });
|
||||
}
|
||||
if (roomTopic !== undefined) {
|
||||
await mx.sendStateEvent(room.roomId, StateEvent.RoomTopic as any, { topic: roomTopic });
|
||||
await mx.sendStateEvent(room.roomId, EventType.RoomTopic, { topic: roomTopic });
|
||||
}
|
||||
},
|
||||
[mx, room.roomId],
|
||||
|
||||
Reference in New Issue
Block a user