fix: resolve syllabus preview/download loading state after filter selection#603
Open
Vedthakar wants to merge 1 commit into
Open
fix: resolve syllabus preview/download loading state after filter selection#603Vedthakar wants to merge 1 commit into
Vedthakar wants to merge 1 commit into
Conversation
…mahor#601) Open syllabus PDFs from Download/Preview actions and reset the opening state so users are not stuck after selecting university, department, and semester. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@Vedthakar is attempting to deploy a commit to the Lovely Mahour's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue where users could become stuck in an infinite loading state when attempting to preview or download a syllabus after applying filters (University, Department, and Semester). Syllabus PDFs now open correctly, and the loading state is properly reset.
Changes
Syllabus Page
Added
fileUrlsupport to syllabus entries.Moved syllabus data outside the component to prevent unnecessary re-creation on each render.
Added
openingSyllabusIdstate to track the syllabus currently being opened.Replaced the mock download handler with a dedicated
openSyllabusFilefunction.Open syllabus PDFs in a new tab using
window.open.Added error handling for:
Ensured loading state is always reset using
finally.UI Improvements
Tests
Added automated test coverage for the reported issue:
Problem Resolved
Previously, after filtering syllabi and attempting to preview or download a syllabus, users could become stuck in a loading state that never completed. This update ensures syllabus files open successfully and prevents users from getting trapped in an infinite loading state.
Testing
Fixes #601
Tags
bugfrontendreactuitestingsyllabususer-experiencefixes-601