Skip to content

Commit

Permalink
feat(notifications): ensure course notices notifs cleared on screen blur
Browse files Browse the repository at this point in the history
  • Loading branch information
umbopepato committed Jan 30, 2024
1 parent e1f0726 commit 02cc123
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/features/courses/screens/CourseNoticesScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { BottomBarSpacer } from '../../../core/components/BottomBarSpacer';
import { useAccessibility } from '../../../core/hooks/useAccessibilty';
import { useNotifications } from '../../../core/hooks/useNotifications';
import { useOfflineDisabled } from '../../../core/hooks/useOfflineDisabled';
import { useOnLeaveScreen } from '../../../core/hooks/useOnLeaveScreen';
import { useSafeAreaSpacing } from '../../../core/hooks/useSafeAreaSpacing';
import { useGetCourseNotices } from '../../../core/queries/courseHooks';
import { GlobalStyles } from '../../../core/styles/GlobalStyles';
Expand All @@ -41,12 +42,14 @@ export const CourseNoticesScreen = () => {
})) ?? [],
[noticesQuery],
);
const noticesNotificationScope = [
'teaching',
'courses',
courseId.toString(),
'notices',
];
const noticesNotificationScope = useMemo(
() => ['teaching', 'courses', courseId.toString(), 'notices'],
[courseId],
);

useOnLeaveScreen(() => {
clearNotificationScope(noticesNotificationScope);
});

return (
<FlatList
Expand Down

0 comments on commit 02cc123

Please sign in to comment.