Skip to content

Commit

Permalink
[Fix] 머지 실수 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
WooYeonSeo committed Dec 5, 2019
1 parent 079b0b5 commit 5a35690
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions client/src/composition/Feed/WritingFeed/WritingFeedContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ import {
import { useEffect } from 'react';

function WritingFeedContainer() {
const { data: writingFeedData } = useQuery(getWritingFeedData);
const { data: { writingFeedContent = null } = {} } = useQuery(
getWritingFeedData
);
const [writingFeedDataMutation] = useMutation(enrollWritingFeedData);
const [fileId, setFileId] = useState(0);
const [files, setFiles] = useState<Maybe<Scalars['Upload']>[]>([]);
const [content, setContent] = useState(
writingFeedData && writingFeedData.writingFeedContent
? writingFeedData.writingFeedContent
: ''
);
const [content, setContent] = useState(writingFeedContent || '');

const contentCursor = useRef<HTMLTextAreaElement>(null);
const [enrollFeedMutation] = useEnrollFeedMutation();
const { data: { me = null } = {} } = useMeQuery();

useEffect(() => {
if (contentCursor.current) {
const len = contentCursor.current.value.length;
Expand Down Expand Up @@ -66,9 +68,6 @@ function WritingFeedContainer() {
}
};

const [enrollFeedMutation] = useEnrollFeedMutation();
const { data } = useMeQuery();

const onSubmit = async (
e: React.FormEvent<HTMLFormElement>
): Promise<void> => {
Expand All @@ -93,9 +92,7 @@ function WritingFeedContainer() {
return (
<WritingFeedPresenter
thumbnail={
data && data.me && data.me.thumbnail
? data.me.thumbnail
: process.env.PUBLIC_URL + '/images/profile.jpg'
(me && me.thumbnail) || process.env.PUBLIC_URL + '/images/profile.jpg'
}
contentCursor={contentCursor}
onSubmit={onSubmit}
Expand Down

0 comments on commit 5a35690

Please sign in to comment.