Use EventType at the state and account data call sites. [skip build]
This commit is contained in:
@@ -3,7 +3,7 @@ import { Box, Chip, IconButton, Line, Scroll, Spinner, Text, config } from 'fold
|
||||
import { useVirtualizer } from '@tanstack/react-virtual';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { JoinRule, RestrictedAllowType, Room } from 'matrix-js-sdk';
|
||||
import { EventType, JoinRule, RestrictedAllowType, Room } from 'matrix-js-sdk';
|
||||
import { RoomJoinRulesEventContent } from 'matrix-js-sdk/lib/types';
|
||||
import { IHierarchyRoom } from 'matrix-js-sdk/lib/@types/spaces';
|
||||
import { produce } from 'immer';
|
||||
@@ -305,7 +305,7 @@ function SpaceCardLobby() {
|
||||
if (!reorder.item.parentId) return;
|
||||
await mx.sendStateEvent(
|
||||
reorder.item.parentId,
|
||||
StateEvent.SpaceChild as any,
|
||||
EventType.SpaceChild,
|
||||
{ ...reorder.item.content, order: reorder.orderKey },
|
||||
reorder.item.roomId,
|
||||
);
|
||||
@@ -330,7 +330,7 @@ function SpaceCardLobby() {
|
||||
|
||||
// remove from current space
|
||||
if (item.parentId !== containerParentId) {
|
||||
mx.sendStateEvent(item.parentId, StateEvent.SpaceChild as any, {}, item.roomId);
|
||||
mx.sendStateEvent(item.parentId, EventType.SpaceChild, {}, item.roomId);
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -350,7 +350,7 @@ function SpaceCardLobby() {
|
||||
joinRuleContent.allow?.filter((allowRule) => allowRule.room_id !== item.parentId) ??
|
||||
[];
|
||||
allow.push({ type: RestrictedAllowType.RoomMembership, room_id: containerParentId });
|
||||
mx.sendStateEvent(itemRoom.roomId, StateEvent.RoomJoinRules as any, {
|
||||
mx.sendStateEvent(itemRoom.roomId, EventType.RoomJoinRules, {
|
||||
...joinRuleContent,
|
||||
allow,
|
||||
});
|
||||
@@ -392,7 +392,7 @@ function SpaceCardLobby() {
|
||||
await rateLimitedActions(reorders, async (reorder) => {
|
||||
await mx.sendStateEvent(
|
||||
containerParentId,
|
||||
StateEvent.SpaceChild as any,
|
||||
EventType.SpaceChild,
|
||||
{ ...reorder.item.content, order: reorder.orderKey },
|
||||
reorder.item.roomId,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user