feat: 앱 계정 레벨 — 하루 출석 각, 아바타 Lv 표시, 내 정보 레벨 카드, 내 레벨·레벨업 창, 공유하면 하루 한 번 각, 각을 주는 일 뒤 레벨 다시 받기. 아이콘 목록을 웹 아이콘 전부로 (GA sheet_open level·levelUp)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
01b5f917b9
commit
e40a9a0539
16 files changed
+360
-19
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { focusManager, keepPreviousData, QueryClient } from '@tanstack/react-query';
|
||||
import { myLevelQueryKey } from '@nalssigak/shared/api/client/@tanstack/react-query.gen';
|
||||
import { focusManager, keepPreviousData, MutationCache, QueryClient } from '@tanstack/react-query';
|
||||
import { AppState, Platform } from 'react-native';
|
||||
|
||||
// 앱이 다시 앞으로 오면 '포커스'로 보고, 5분 넘게 묵은 데이터만 다시 받는다
|
||||
@@ -10,6 +11,8 @@ if (Platform.OS !== 'web') {
|
||||
}
|
||||
|
||||
// 웹과 같은 기본값: 다시 받는 동안 이전 결과를 그대로 두어 화면이 비지 않게 한다
|
||||
export const queryClient = new QueryClient({
|
||||
export const queryClient: QueryClient = new QueryClient({
|
||||
defaultOptions: { queries: { staleTime: 5 * 60 * 1000, retry: 1, placeholderData: keepPreviousData } },
|
||||
// 각을 주는 일(좋아요·댓글·글·공유·사주)은 모두 mutation 이라, 끝나면 내 레벨을 다시 받는다 (웹 main.tsx)
|
||||
mutationCache: new MutationCache({ onSuccess: () => queryClient.invalidateQueries({ queryKey: myLevelQueryKey() }) }),
|
||||
});
|
||||
Reference in new issue
Block a user