File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
course-matrix/frontend/src/pages/Home Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ export const EmailNotificationSettings = ({
2828 const [ updateTimetable ] = useUpdateTimetableMutation ( ) ;
2929 const [ toggled , setToggled ] = useState < boolean > ( false ) ;
3030
31+ const handleCancel = ( ) => {
32+ setToggled ( ( data as TimetableModel [ ] ) [ 0 ] ?. email_notifications_enabled ) ;
33+ }
34+
3135 useEffect ( ( ) => {
3236 if ( data ) {
3337 const val = ( data as TimetableModel [ ] ) [ 0 ] ?. email_notifications_enabled ;
@@ -79,7 +83,7 @@ export const EmailNotificationSettings = ({
7983 </ div >
8084 < DialogFooter >
8185 < DialogClose asChild >
82- < Button variant = "outline" > Cancel</ Button >
86+ < Button variant = "outline" onClick = { handleCancel } > Cancel</ Button >
8387 </ DialogClose >
8488 < DialogClose asChild >
8589 < Button onClick = { handleUpdateEmailNotifications } > Save</ Button >
You can’t perform that action at this time.
0 commit comments