ReviewDB fixes

This commit is contained in:
Vendicated 2024-01-15 17:36:24 +01:00
parent 8bd54173db
commit a171b35e97
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
4 changed files with 24 additions and 24 deletions

View file

@ -28,8 +28,8 @@ import { cl } from "../utils";
import ReviewComponent from "./ReviewComponent";
const Slate = findByPropsLazy("Editor", "Transforms");
const InputTypes = findByPropsLazy("ChatInputTypes");
const { Editor, Transforms } = findByPropsLazy("Editor", "Transforms");
const { ChatInputTypes } = findByPropsLazy("ChatInputTypes");
const InputComponent = LazyComponent(() => find(m => m.default?.type?.render?.toString().includes("default.CHANNEL_TEXT_AREA")).default);
@ -122,7 +122,7 @@ function ReviewList({ refetch, reviews, hideOwnReview, profileId }: { refetch():
export function ReviewsInputComponent({ discordId, isAuthor, refetch, name }: { discordId: string, name: string; isAuthor: boolean; refetch(): void; }) {
const { token } = Auth;
const editorRef = useRef<any>(null);
const inputType = InputTypes.ChatInputTypes.FORM;
const inputType = ChatInputTypes.FORM;
inputType.disableAutoFocus = true;
const channel = {
@ -172,10 +172,9 @@ export function ReviewsInputComponent({ discordId, isAuthor, refetch, name }: {
refetch();
const slateEditor = editorRef.current.ref.current.getSlateEditor();
const { Editor, Transform } = Slate;
// clear editor
Transform.delete(slateEditor, {
Transforms.delete(slateEditor, {
at: {
anchor: Editor.start(slateEditor, []),
focus: Editor.end(slateEditor, []),