Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fixed #2734 (#2742)

Bennett B Madavanac41fa16102fc
diff --git a/web/components/chat/ChatTextField/ChatTextField.tsx b/web/components/chat/ChatTextField/ChatTextField.tsx
index dc244b2c8c..66796e5575 100644
--- a/web/components/chat/ChatTextField/ChatTextField.tsx
+++ b/web/components/chat/ChatTextField/ChatTextField.tsx
@@ -169,31 +169,10 @@ export const ChatTextField: FC<ChatTextFieldProps> = ({ defaultText }) => {
const insertImage = (url, name) => {
if (!url) return;
- const { selection } = editor;
const image = createImageNode(name, url, name);
- Transforms.insertNodes(editor, image, { select: true });
-
- if (selection) {
- const [parentNode, parentPath] = Editor.parent(editor, selection.focus?.path);
-
- if (editor.isVoid(parentNode) || Node.string(parentNode).length) {
- // Insert the new image node after the void node or a node with content
- Transforms.insertNodes(editor, image, {
- at: Path.next(parentPath),
- select: true,
- });
- } else {
- // If the node is empty, replace it instead
- // Transforms.removeNodes(editor, { at: parentPath });
- Transforms.insertNodes(editor, image, { at: parentPath, select: true });
- Editor.normalize(editor, { force: true });
- }
- } else {
- // Insert the new image node at the bottom of the Editor when selection
- // is falsey
- Transforms.insertNodes(editor, image, { select: true });
- }
+ Transforms.insertNodes(editor, image);
+ Editor.normalize(editor, { force: true });
};
// Native emoji