- AddTransactionButton.tsx: useEffect import 제거 - BudgetProgressCard.tsx: localBudgetData를 _localBudgetData로 변경 - Header.tsx: isMobile을 _isMobile로 변경 - RecentTransactionsSection.tsx: isDeleting을 _isDeleting로 변경 - TransactionCard.tsx: cn import 제거 - ExpenseForm.tsx: useState import 제거 - cacheStrategies.ts: QueryClient, Transaction import 제거 - Analytics.tsx: Separator import 제거, 미사용 변수들에 underscore prefix 추가 - Index.tsx: useMemo import 제거 - Login.tsx: setLoginError를 _setLoginError로 변경 - Register.tsx: useEffect dependency 수정 및 useCallback 추가 - Settings.tsx: toast, handleClick에 underscore prefix 추가 - authStore.ts: setError, setAppwriteInitialized에 underscore prefix 추가 - budgetStore.ts: ranges를 _ranges로 변경 - BudgetProgressCard.test.tsx: waitFor import 제거 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { useEffect } from "react";
|
|
import { logger } from "@/utils/logger";
|
|
import { useAuth } from "@/stores";
|
|
import useNotifications from "@/hooks/useNotifications";
|
|
|
|
/**
|
|
* 앱 초기화 후 환영 메시지 알림을 표시하는 커스텀 훅
|
|
*/
|
|
export const useWelcomeNotification = (isInitialized: boolean) => {
|
|
const { user } = useAuth();
|
|
const { addNotification } = useNotifications();
|
|
|
|
useEffect(() => {
|
|
try {
|
|
// 환영 메시지가 이미 표시되었는지 확인하는 키
|
|
const welcomeNotificationSent = sessionStorage.getItem(
|
|
"welcomeNotificationSent"
|
|
);
|
|
|
|
if (isInitialized && user && !welcomeNotificationSent) {
|
|
// 사용자 로그인 시 알림 예시 (한 번만 실행)
|
|
const timeoutId = setTimeout(() => {
|
|
addNotification(
|
|
"환영합니다!",
|
|
"젤리의 적자탈출에 오신 것을 환영합니다. 예산을 설정하고 지출을 기록해보세요."
|
|
);
|
|
// 세션 스토리지에 환영 메시지 표시 여부 저장
|
|
sessionStorage.setItem("welcomeNotificationSent", "true");
|
|
}, 2000);
|
|
|
|
return () => clearTimeout(timeoutId);
|
|
}
|
|
} catch (error) {
|
|
logger.error("환영 메시지 알림 표시 중 오류:", error);
|
|
}
|
|
}, [isInitialized, user, addNotification]);
|
|
};
|