Skip to content

Commit 875beee

Browse files
Feat(client): acorns 추가 알림 tooltip window focus 될 때 뜨도록 변경 (#309)
* feat: updateToReadStatus에 도토리 개수 invalidateQueries 제거 * feat: useGetAcorns에 refetchOnWindowFocus 옵션 추가 및 usePutArticleReadStatus에 refetchType: none 옵션 추가
1 parent 2661dd0 commit 875beee

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

apps/client/src/pages/myBookmark/components/myBookmarkContent/MyBookmarkContent.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ const MyBookmarkContent = ({
9898
queryClient.invalidateQueries({
9999
queryKey: ['categoryBookmarkArticles'],
100100
});
101-
queryClient.invalidateQueries({ queryKey: ['acorns'] });
102101
},
103102
onError: (error: any) => {
104103
console.error(error);

apps/client/src/shared/apis/queries.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const useGetAcorns = (): UseQueryResult<AcornsResponse, AxiosError> => {
8484
return useQuery({
8585
queryKey: ['acorns'],
8686
queryFn: () => getAcorns(),
87+
refetchOnWindowFocus: true,
8788
});
8889
};
8990

@@ -129,6 +130,7 @@ export const usePutArticleReadStatus = (): UseMutationResult<
129130
});
130131
queryClient.invalidateQueries({
131132
queryKey: ['acorns'],
133+
refetchType: 'none',
132134
});
133135
queryClient.invalidateQueries({
134136
queryKey: ['bookmarkReadArticles'],

0 commit comments

Comments
 (0)