mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
Fix: Editor would not open "delete_message".
Fix: Clear status if empty string given.
This commit is contained in:
parent
1aa2b1226a
commit
d2904f57ab
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
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 {
|
||||||
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() {
|
||||||
|
|
Loading…
Reference in a new issue