diff options
author | Vitaly Takmazov | 2019-08-15 09:56:12 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:55 +0300 |
commit | adf830dfcd1350e104b92a0f088e5664a35b7b15 (patch) | |
tree | d3c1537144ba33fdddd975b39f8b8d1bf0057c30 /vnext/src/ui/Thread.js | |
parent | 30723a1df4688c421ccd8ec7b9d804c0bd3d020a (diff) |
jsdoc updates
Diffstat (limited to 'vnext/src/ui/Thread.js')
-rw-r--r-- | vnext/src/ui/Thread.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vnext/src/ui/Thread.js b/vnext/src/ui/Thread.js index e469b8cf..cbd40c4c 100644 --- a/vnext/src/ui/Thread.js +++ b/vnext/src/ui/Thread.js @@ -16,6 +16,10 @@ import { bubbleStyle, chatItemStyle } from './helpers/BubbleStyle'; import './Thread.css'; let isMounted; +/** + * @type import('../api').Message + */ +const emptyMessage = {}; /** * @param {{ @@ -122,7 +126,8 @@ export default function Thread(props) { const [replies, setReplies] = useState([]); const [loading, setLoading] = useState(false); const [active, setActive] = useState(0); - const [editing, setEditing] = useState({}); + + const [editing, setEditing] = useState(emptyMessage); const [hash, setHash] = useState(props.visitor.hash); const { mid } = props.match.params; @@ -162,7 +167,7 @@ export default function Thread(props) { const { mid, rid, body, attach } = template; let commentAction = editing.rid ? update(mid, editing.rid, body) : comment(mid, rid, body, attach); commentAction.then(res => { - setEditing({}); + setEditing(emptyMessage); loadReplies(); }) .catch(console.log); |