infra changes
This commit is contained in:
@@ -24,4 +24,5 @@ export const DevStore = createLocalStore<IDevStore>({
|
||||
reloadTabId: undefined,
|
||||
});
|
||||
|
||||
|
||||
debugStore({ DevStore });
|
||||
|
||||
@@ -17,7 +17,7 @@ interface Actions {
|
||||
getDeviceId(): Promise<string>;
|
||||
}
|
||||
|
||||
const ExtensionStore = createLocalStore<IExtensionStore, Actions>(
|
||||
export const ExtensionStore = createLocalStore<IExtensionStore, Actions>(
|
||||
{
|
||||
version: chrome.runtime.getManifest().version,
|
||||
lastUpdate: Date.now(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createLocalStore, debugStore, Serialized } from 'chrome-extension-toolkit';
|
||||
import { createLocalStore, debugStore } from 'chrome-extension-toolkit';
|
||||
import { Course } from 'src/shared/types/Course';
|
||||
/**
|
||||
* A store that is used for storing user options
|
||||
@@ -44,7 +44,7 @@ const UserScheduleStore = createLocalStore<IUserScheduleStore, Actions>(
|
||||
const schedules = await store.getSchedules();
|
||||
const scheduleToEdit = schedules[name];
|
||||
if (scheduleToEdit) {
|
||||
scheduleToEdit.push(course as Serialized<Course>);
|
||||
scheduleToEdit.push(course);
|
||||
await store.setSchedules(schedules);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -66,7 +66,7 @@ export class Course {
|
||||
/** Which semester is the course from */
|
||||
semester: Semester;
|
||||
|
||||
constructor(course: Serialized<Course> | Course) {
|
||||
constructor(course: Serialized<Course>) {
|
||||
Object.assign(this, course);
|
||||
this.schedule = new CourseSchedule(course.schedule);
|
||||
this.instructors = course.instructors.map(i => new Instructor(i));
|
||||
|
||||
@@ -37,7 +37,7 @@ export class CourseMeeting {
|
||||
/** The location that the course is taught */
|
||||
location?: Location;
|
||||
|
||||
constructor(meeting: Serialized<CourseMeeting> | CourseMeeting) {
|
||||
constructor(meeting: Serialized<CourseMeeting>) {
|
||||
Object.assign(this, meeting);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { CourseMeeting, Day, DAY_MAP } from './CourseMeeting';
|
||||
export class CourseSchedule {
|
||||
meetings: CourseMeeting[] = [];
|
||||
|
||||
constructor(courseSchedule?: Serialized<CourseSchedule> | CourseSchedule) {
|
||||
constructor(courseSchedule?: Serialized<CourseSchedule>) {
|
||||
if (!courseSchedule) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user