Skip to content

Commit

Permalink
fix(canvas): 🐛 fix matching of course id from url (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNZL committed Jul 26, 2022
1 parent 913a88f commit b418a41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/popup/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function roundToNextHour(date: Date): Date {
(async function fetchAssignments(): Promise<SavedAssignments | void> {
try {
const { origin, pathname } = window.location;
const courseId = pathname.match(/\/courses\/([^/]+)\//)?.[1];
const courseId = pathname.match(/\/courses\/([^/]+)\/?/)?.[1];

if (!courseId) {
throw 'This is an invalid Canvas course page.\n\nPlease navigate to a Canvas course page (or any subpage), and try again.\n\nExample: https://canvas.auckland.ac.nz/courses/72763/...';
Expand Down

0 comments on commit b418a41

Please sign in to comment.