Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -1,7 +1,28 @@
|
||||
import React, { FormEventHandler, MouseEventHandler, useCallback, useEffect, useState } from 'react';
|
||||
import React, {
|
||||
FormEventHandler,
|
||||
MouseEventHandler,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { MatrixError, Room } from 'matrix-js-sdk';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { Box, Button, Chip, color, config, Input, Menu, MenuItem, PopOut, RectCords, Spinner, Switch, Text, TextArea } from 'folds';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Chip,
|
||||
color,
|
||||
config,
|
||||
Input,
|
||||
Menu,
|
||||
MenuItem,
|
||||
PopOut,
|
||||
RectCords,
|
||||
Spinner,
|
||||
Switch,
|
||||
Text,
|
||||
TextArea,
|
||||
} from 'folds';
|
||||
import { Icon, Icons } from '../../components/icons';
|
||||
import { SettingTile } from '../../components/setting-tile';
|
||||
import { SequenceCard } from '../../components/sequence-card';
|
||||
@@ -62,7 +83,7 @@ export function CreateSpaceForm({ defaultKind, space, onCreate }: CreateSpaceFor
|
||||
const allowRestricted = space && restrictedSupported(selectedRoomVersion);
|
||||
|
||||
const [kind, setKind] = useState(
|
||||
defaultKind ?? allowRestricted ? CreateRoomKind.Restricted : CreateRoomKind.Private
|
||||
(defaultKind ?? allowRestricted) ? CreateRoomKind.Restricted : CreateRoomKind.Private,
|
||||
);
|
||||
|
||||
const allowAdditionalCreators = creatorsSupported(selectedRoomVersion);
|
||||
@@ -94,7 +115,7 @@ export function CreateSpaceForm({ defaultKind, space, onCreate }: CreateSpaceFor
|
||||
};
|
||||
|
||||
const [createState, create] = useAsyncCallback<string, Error | MatrixError, [CreateRoomData]>(
|
||||
useCallback((data) => createRoom(mx, data), [mx])
|
||||
useCallback((data) => createRoom(mx, data), [mx]),
|
||||
);
|
||||
const loading = createState.status === AsyncStatus.Loading;
|
||||
const error = createState.status === AsyncStatus.Error ? createState.error : undefined;
|
||||
@@ -146,12 +167,7 @@ export function CreateSpaceForm({ defaultKind, space, onCreate }: CreateSpaceFor
|
||||
}).then(async (roomId) => {
|
||||
if (spaceType === RoomType.Forum) {
|
||||
try {
|
||||
await mx.sendStateEvent(
|
||||
roomId,
|
||||
StateEvent.PaarrotRoomKind,
|
||||
{ kind: 'forum_space' },
|
||||
''
|
||||
);
|
||||
await mx.sendStateEvent(roomId, StateEvent.PaarrotRoomKind, { kind: 'forum_space' }, '');
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('Failed to set forum space marker state event:', err);
|
||||
@@ -250,8 +266,8 @@ export function CreateSpaceForm({ defaultKind, space, onCreate }: CreateSpaceFor
|
||||
)}
|
||||
{parentIsForum && (
|
||||
<Text size="T200" priority="300">
|
||||
Creates a forum category (subspace). Add topics inside it with Add Topic after selecting the
|
||||
category in the filter bar.
|
||||
Creates a forum category (subspace). Add topics inside it with Add Topic after selecting
|
||||
the category in the filter bar.
|
||||
</Text>
|
||||
)}
|
||||
<Box shrink="No" direction="Column" gap="100">
|
||||
@@ -362,7 +378,7 @@ export function CreateSpaceForm({ defaultKind, space, onCreate }: CreateSpaceFor
|
||||
<b>
|
||||
{error instanceof MatrixError && error.name === ErrorCode.M_LIMIT_EXCEEDED
|
||||
? `Server rate-limited your request for ${millisecondsToMinutes(
|
||||
(error.data.retry_after_ms as number | undefined) ?? 0
|
||||
(error.data.retry_after_ms as number | undefined) ?? 0,
|
||||
)} minutes!`
|
||||
: error.message}
|
||||
</b>
|
||||
|
||||
Reference in New Issue
Block a user