Use EventType at the state and account data call sites. [skip build]
Checks / checks (push) Successful in 2m4s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-01 23:50:13 +11:00
parent 634d1e0a0f
commit 48db806dd7
7 changed files with 32 additions and 30 deletions
@@ -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],