mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-23 22:22:07 -05:00
fix: check if content actually exists
chore: update lang submodule
This commit is contained in:
parent
5b31ce494e
commit
21175dffda
2 changed files with 10 additions and 12 deletions
2
external/lang
vendored
2
external/lang
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 995fe65707cae9162b34d58ba0159e78d1b3e37e
|
||||
Subproject commit 7f87139f7962b55e90c1cfd50fbca64766b5886c
|
|
@ -23,6 +23,7 @@ import {
|
|||
} from "../../../lib/renderer/Singleton";
|
||||
|
||||
import { state, useApplicationState } from "../../../mobx/State";
|
||||
import { DraftObject } from "../../../mobx/stores/Draft";
|
||||
import { Reply } from "../../../mobx/stores/MessageQueue";
|
||||
|
||||
import { dayjs } from "../../../context/Locale";
|
||||
|
@ -45,8 +46,6 @@ import { PermissionTooltip } from "../Tooltip";
|
|||
import FilePreview from "./bars/FilePreview";
|
||||
import ReplyBar from "./bars/ReplyBar";
|
||||
|
||||
import { DraftObject } from "../../../mobx/stores/Draft";
|
||||
|
||||
type Props = {
|
||||
channel: Channel;
|
||||
};
|
||||
|
@ -281,9 +280,9 @@ export default observer(({ channel }: Props) => {
|
|||
const setMessage = useCallback(
|
||||
(content?: string) => {
|
||||
const dobj: DraftObject = {
|
||||
content
|
||||
}
|
||||
state.draft.set(channel._id, dobj)
|
||||
content,
|
||||
};
|
||||
state.draft.set(channel._id, dobj);
|
||||
},
|
||||
[state.draft, channel._id],
|
||||
);
|
||||
|
@ -615,12 +614,11 @@ export default observer(({ channel }: Props) => {
|
|||
onSelect={(emoji) => {
|
||||
const v = state.draft.get(channel._id);
|
||||
const cnt: DraftObject = {
|
||||
content: (v == null ? "" : `${v.content} `) + `:${emoji}:`
|
||||
}
|
||||
state.draft.set(
|
||||
channel._id,
|
||||
cnt,
|
||||
);
|
||||
content:
|
||||
(v?.content ? `${v.content} ` : "") +
|
||||
`:${emoji}:`,
|
||||
};
|
||||
state.draft.set(channel._id, cnt);
|
||||
}}
|
||||
onClose={closePicker}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue