Fix welcome message and sync

- Prevent duplicate welcome messages.
- Remove sync notifications.
- Ensure automatic sync updates last sync time.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 06:26:05 +00:00
parent eb25423b27
commit 09894589b4
8 changed files with 173 additions and 27 deletions

View File

@@ -41,13 +41,18 @@ const Index = () => {
// 앱 시작시 예시 알림 추가 (실제 앱에서는 필요한 이벤트에 따라 알림 추가)
useEffect(() => {
if (isInitialized && user) {
// 사용자 로그인 시 알림 예시
// 환영 메시지가 이미 표시되었는지 확인하는 키
const welcomeNotificationSent = sessionStorage.getItem('welcomeNotificationSent');
if (isInitialized && user && !welcomeNotificationSent) {
// 사용자 로그인 시 알림 예시 (한 번만 실행)
const timeoutId = setTimeout(() => {
addNotification(
'환영합니다!',
'젤리의 적자탈출에 오신 것을 환영합니다. 예산을 설정하고 지출을 기록해보세요.'
);
// 세션 스토리지에 환영 메시지 표시 여부 저장
sessionStorage.setItem('welcomeNotificationSent', 'true');
}, 2000);
return () => clearTimeout(timeoutId);