Fix the ref, upload, keyframes, and implicit-any type errors. [skip build]
This commit is contained in:
@@ -7,8 +7,8 @@ import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||
import { useFilePicker } from '../../hooks/useFilePicker';
|
||||
import { safeFile } from '../../utils/mimeTypes';
|
||||
import { fulfilledPromiseSettledResult } from '../../utils/common';
|
||||
import { TUploadContent } from '../../utils/matrix';
|
||||
import {
|
||||
TUploadContent,
|
||||
TUploadItem,
|
||||
TUploadMetadata,
|
||||
roomIdToUploadItemsAtomFamily,
|
||||
@@ -199,7 +199,7 @@ export function ForumPostUploadField({
|
||||
export function useForumPostUploads(roomId: string) {
|
||||
const mx = useMatrixClient();
|
||||
const [selectedFiles, setSelectedFiles] = useAtom(roomIdToUploadItemsAtomFamily(roomId));
|
||||
const uploadBoardHandlers = useRef<UploadBoardImperativeHandlers>();
|
||||
const uploadBoardHandlers = useRef<UploadBoardImperativeHandlers | undefined>(undefined);
|
||||
const uploadResolverRef = useRef<{
|
||||
resolve: (contents: IContent[]) => void;
|
||||
reject: (err: unknown) => void;
|
||||
|
||||
@@ -13,7 +13,7 @@ type ForumReplyComposerProps = {
|
||||
roomId: string;
|
||||
threadRootId: string;
|
||||
replyToEventId: string;
|
||||
fileDropContainerRef: RefObject<HTMLElement>;
|
||||
fileDropContainerRef: RefObject<HTMLElement | null>;
|
||||
onSent?: () => void;
|
||||
onCancel?: () => void;
|
||||
};
|
||||
|
||||
@@ -124,7 +124,7 @@ type ForumThreadMessageProps = {
|
||||
room: Room;
|
||||
roomId: string;
|
||||
threadRootId: string;
|
||||
fileDropContainerRef: RefObject<HTMLElement>;
|
||||
fileDropContainerRef: RefObject<HTMLElement | null>;
|
||||
editEventId?: string;
|
||||
onEditEventId: (eventId?: string) => void;
|
||||
onComposerSent: () => void;
|
||||
@@ -303,7 +303,7 @@ type ForumThreadDetailProps = {
|
||||
rootEventId: string;
|
||||
titleHint?: string;
|
||||
initialPost?: ForumPost | null;
|
||||
fileDropContainerRef?: RefObject<HTMLElement>;
|
||||
fileDropContainerRef?: RefObject<HTMLElement | null>;
|
||||
onReplySent?: (reply: ForumPost) => void;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ export type CanDropCallback = (item: HierarchyItem, container: DropContainerData
|
||||
|
||||
export const useDraggableItem = (
|
||||
item: HierarchyItem,
|
||||
targetRef: RefObject<HTMLElement>,
|
||||
targetRef: RefObject<HTMLElement | null>,
|
||||
onDragging: (item?: HierarchyItem) => void,
|
||||
dragHandleRef?: RefObject<HTMLElement>,
|
||||
dragHandleRef?: RefObject<HTMLElement | null>,
|
||||
): boolean => {
|
||||
const [dragging, setDragging] = useState(false);
|
||||
|
||||
@@ -120,7 +120,7 @@ export function AfterItemDropTarget({
|
||||
}
|
||||
|
||||
export const useDnDMonitor = (
|
||||
scrollRef: RefObject<HTMLElement>,
|
||||
scrollRef: RefObject<HTMLElement | null>,
|
||||
onDragging: (item?: HierarchyItem) => void,
|
||||
onReorder: (item: HierarchyItem, container: DropContainerData) => void,
|
||||
) => {
|
||||
|
||||
@@ -42,7 +42,7 @@ type MessageSearchProps = {
|
||||
allowGlobal?: boolean;
|
||||
rooms: string[];
|
||||
senders?: string[];
|
||||
scrollRef: RefObject<HTMLDivElement>;
|
||||
scrollRef: RefObject<HTMLDivElement | null>;
|
||||
};
|
||||
export function MessageSearch({
|
||||
defaultRoomsFilterName,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Icon, Icons } from '../../components/icons';
|
||||
type SearchProps = {
|
||||
active?: boolean;
|
||||
loading?: boolean;
|
||||
searchInputRef: RefObject<HTMLInputElement>;
|
||||
searchInputRef: RefObject<HTMLInputElement | null>;
|
||||
onSearch: (term: string) => void;
|
||||
onReset: () => void;
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ const createCarouselUuid = (): string => {
|
||||
|
||||
interface RoomInputProps {
|
||||
editor: Editor;
|
||||
fileDropContainerRef: RefObject<HTMLElement>;
|
||||
fileDropContainerRef: RefObject<HTMLElement | null>;
|
||||
roomId: string;
|
||||
room: Room;
|
||||
/** When provided, all messages are sent as replies in this thread. */
|
||||
@@ -207,7 +207,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||
roomUploadAtomFamily,
|
||||
selectedFiles.map((f) => f.file),
|
||||
);
|
||||
const uploadBoardHandlers = useRef<UploadBoardImperativeHandlers>();
|
||||
const uploadBoardHandlers = useRef<UploadBoardImperativeHandlers | undefined>(undefined);
|
||||
const editorRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const imagePackRooms: Room[] = useImagePackRooms(roomId, roomToParents);
|
||||
|
||||
@@ -373,7 +373,7 @@ export const getEventIdAbsoluteIndex = (
|
||||
type RoomTimelineProps = {
|
||||
room: Room;
|
||||
eventId?: string;
|
||||
roomInputRef: RefObject<HTMLElement>;
|
||||
roomInputRef: RefObject<HTMLElement | null>;
|
||||
editor: Editor;
|
||||
};
|
||||
|
||||
@@ -665,7 +665,7 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
|
||||
const [unreadInfo, setUnreadInfo] = useState(() =>
|
||||
getRoomUnreadInfo(room, scrollToLatestBehavior !== ScrollToLatestBehavior.Always),
|
||||
);
|
||||
const readUptoEventIdRef = useRef<string>();
|
||||
const readUptoEventIdRef = useRef<string | undefined>(undefined);
|
||||
if (unreadInfo) {
|
||||
readUptoEventIdRef.current = unreadInfo.readUptoEventId;
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ export function Search({ requestClose }: SearchProps) {
|
||||
allowOutsideClick: true,
|
||||
clickOutsideDeactivates: true,
|
||||
onDeactivate: requestClose,
|
||||
escapeDeactivates: (evt) => {
|
||||
escapeDeactivates: (evt: KeyboardEvent) => {
|
||||
evt.stopPropagation();
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user