Skip to content
Snippets Groups Projects
Commit d2904f57 authored by insert's avatar insert
Browse files

Fix: Editor would not open "delete_message".

Fix: Clear status if empty string given.
parent 1aa2b122
Branches
No related merge requests found
...@@ -119,7 +119,7 @@ export function SpecialInputModal(props: SpecialProps) { ...@@ -119,7 +119,7 @@ export function SpecialInputModal(props: SpecialProps) {
client.users.editUser({ client.users.editUser({
status: { status: {
...client.user?.status, ...client.user?.status,
text text: text.trim().length > 0 ? text : undefined
} }
}) })
} }
......
import styled from "styled-components"; import styled from "styled-components";
import { useContext, useEffect, useState } from "preact/hooks";
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize"; import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
import { MessageObject } from "../../../context/revoltjs/util"; import { MessageObject } from "../../../context/revoltjs/util";
import { useContext, useEffect, useState } from "preact/hooks";
import { AppContext } from "../../../context/revoltjs/RevoltClient"; import { AppContext } from "../../../context/revoltjs/RevoltClient";
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice"; import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
import { IntermediateContext } from "../../../context/intermediate/Intermediate"; import { IntermediateContext, useIntermediate } from "../../../context/intermediate/Intermediate";
const EditorBase = styled.div` const EditorBase = styled.div`
display: flex; display: flex;
...@@ -40,6 +40,7 @@ interface Props { ...@@ -40,6 +40,7 @@ interface Props {
export default function MessageEditor({ message, finish }: Props) { export default function MessageEditor({ message, finish }: Props) {
const [ content, setContent ] = useState(message.content as string ?? ''); const [ content, setContent ] = useState(message.content as string ?? '');
const { focusTaken } = useContext(IntermediateContext); const { focusTaken } = useContext(IntermediateContext);
const { openScreen } = useIntermediate();
const client = useContext(AppContext); const client = useContext(AppContext);
async function save() { async function save() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment