Fix toast and sync settings

- Fix issue where toast notifications were not disappearing.
- Ensure sync settings are turned off upon logout.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-16 10:37:26 +00:00
parent dab1a9cb84
commit 14c3fac824
6 changed files with 63 additions and 13 deletions

View File

@@ -47,11 +47,26 @@ export function dispatch(action: Action) {
time: now
};
// REMOVE_TOAST 액션 우선순위 높임
if (action.type === actionTypes.REMOVE_TOAST) {
// 즉시 처리
memoryState = reducer(memoryState, action);
listeners.forEach((listener) => {
listener(memoryState);
});
return;
}
// 실제 상태 업데이트 및 리스너 호출
memoryState = reducer(memoryState, action)
memoryState = reducer(memoryState, action);
listeners.forEach((listener) => {
listener(memoryState)
})
listener(memoryState);
});
}
// 토스트 모두 제거 헬퍼 함수
export function clearAllToasts() {
dispatch({ type: actionTypes.REMOVE_TOAST });
}
export { memoryState };