-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update copy schedules #182
Conversation
@@ -71,6 +71,12 @@ function App() { | |||
//Don't set the term to WF, just keep the term to what is selected | |||
setCurrentTerm(newData.terms.values().next().value) | |||
} | |||
} else if (changes.sections) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listening to the storage change event here creates extra re-renders — like if we add a section to state + write it to storage, this will read it from storage + set state again, which is an unnecessary read+render cycle.
not a huge concern, but if you want to avoid it, probably a good idea to use a CustomEvent
to tell the extension to refresh state instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I am going to leave it out of this PR for the moment since it may affect potential state interactions. I will look into it further once this PR merges
src/content/utils.ts
Outdated
@@ -48,7 +48,7 @@ async function extractSection(element: Element, bypassDetailsCheck?: boolean) { | |||
} | |||
} | |||
|
|||
const extractIdFromDOM = (element: Element) => { | |||
export const extractIdFromDOM = (element: Element) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the export at the bottom of the file instead
selectedSection = await findCourseInfo(code) | ||
} | ||
} catch { | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be good to store which sections couldn't be added, and alert the user at the end so they're aware of it
src/domManipulators/copySchedules.ts
Outdated
// eslint-disable-next-line no-await-in-loop | ||
const selectedSection = await findCourseInfo(code) | ||
let selectedSection = null | ||
console.log(tableData[i][tableData[i].length - 1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove log? and the commented-out Browser
imports in various places
What Issue does this PR resolve? (Link to GitHub Issue, approved features and bugs will be given priority)
Please provide a video demo below, or a screenshot and description of the change.
Tag reviewers for the PR below.