Skip to content
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

Merged
merged 4 commits into from
Sep 2, 2024
Merged

Update copy schedules #182

merged 4 commits into from
Sep 2, 2024

Conversation

mlool
Copy link
Owner

@mlool mlool commented Sep 1, 2024

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.

@@ -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) {
Copy link
Collaborator

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.

Copy link
Owner Author

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

@@ -48,7 +48,7 @@ async function extractSection(element: Element, bypassDetailsCheck?: boolean) {
}
}

const extractIdFromDOM = (element: Element) => {
export const extractIdFromDOM = (element: Element) => {
Copy link
Collaborator

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
Copy link
Collaborator

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

// eslint-disable-next-line no-await-in-loop
const selectedSection = await findCourseInfo(code)
let selectedSection = null
console.log(tableData[i][tableData[i].length - 1])
Copy link
Collaborator

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

@mlool mlool merged commit 0b86927 into develop Sep 2, 2024
1 check passed
@mlool mlool deleted the updateCopySchedules branch September 2, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants