Skip to content

Commit

Permalink
fix: disable button and add loading for sync ccxp
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJustChew committed Feb 17, 2024
1 parent 6d272b7 commit 7a8db25
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Timetable/TimetableCourseList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,11 @@ const HeadlessSyncCourseButton = () => {
setCoursesToAdd(courses_to_add);
setLoading(false);
}
return <Button variant="outline" onClick={handleSync}>
<FolderSync className="w-4 h-4 mr-1" /> {dict.timetable.actions.sync_ccxp}
return <Button variant="outline" onClick={handleSync} disabled={loading}>
{!loading?
<><FolderSync className="w-4 h-4 mr-1" /> {dict.timetable.actions.sync_ccxp}</>:
"Loading"
}
</Button>
}

Expand Down

0 comments on commit 7a8db25

Please sign in to comment.