refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-29 08:49:34 +08:00
parent 43a13f8d08
commit 96017c8fc6
21 changed files with 150 additions and 90 deletions
+2 -2
View File
@@ -52,10 +52,10 @@ type Props = {
};
const EditMessage: FC<Props> = ({ mid, cancelEdit }) => {
const inputRef = useRef<HTMLTextAreaElement>(null);
const msg = useAppSelector((store) => store.message[mid] || {});
const msg = useAppSelector((store) => store.message[mid]);
const [shift, setShift] = useState(false);
const [enter, setEnter] = useState(false);
const [currMsg, setCurrMsg] = useState(msg.content);
const [currMsg, setCurrMsg] = useState(msg?.content);
const [edit, { isLoading: isEditing, isSuccess }] = useEditMessageMutation();
useEffect(() => {
if (isSuccess) {