Skip to content

Commit

Permalink
(#247) slow 3G 환경에서도 #247이 여전히 재현되는 버그 수정 (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
GooJinSun authored Apr 8, 2023
2 parents 750a5ad + b49a26c commit 9adde2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Link, useHistory, useLocation } from 'react-router-dom';
import { Link, useLocation } from 'react-router-dom';
import FavoriteIcon from '@material-ui/icons/Favorite';
import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder';
import CreateIcon from '@material-ui/icons/Create';
Expand All @@ -27,8 +27,6 @@ import NewResponse from './new-response/NewResponse';
export default function QuestionItem({ questionObj, onSubmit }) {
const dispatch = useDispatch();
const location = useLocation();
const history = useHistory();
const isQuestionList = location.pathname === '/questions';
const isAnon =
location?.pathname.includes('anonymous') ||
location?.search?.includes('anonymous=True');
Expand Down Expand Up @@ -84,8 +82,6 @@ export default function QuestionItem({ questionObj, onSubmit }) {
const onSubmitHandler = () => {
onSubmit?.();
setIsWriting(false);

if (isQuestionList) history.push('/home');
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ export default function ShareSettings({
);
history.push(location.pathname.slice(0, -4));
} else {
resetContent?.();

await dispatch(
createPost({
...postObj,
...shareState
})
);
resetContent?.();

// FIXME: feed는 캐싱하면 의도치 않게 stale한 응답을 보여줄 수 있음
refetchFriendPostList({ refetchPage: () => true });

if (location.pathname === '/questions') history.push('/home');
}

onSubmit?.();
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/friend-feed/FriendFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const FriendFeed = () => {
fetchNextPage,
isFetchingNextPage,
isFetching,
isLoading,
refetch: refetchFriendPostList
} = useInfiniteFriendPostList();

Expand Down Expand Up @@ -71,7 +70,7 @@ const FriendFeed = () => {
<PostList
posts={friendPosts}
isAppending={isFetchingNextPage}
isLoading={isLoading}
isLoading={isFetching}
/>
)}
<ScrollTopButton callback={refetchFriendPostList} />
Expand Down

0 comments on commit 9adde2b

Please sign in to comment.