chore: lint and format repo - 1 lint error left

This commit is contained in:
doprz
2024-03-05 23:06:12 -06:00
committed by Razboy20
parent 8f360206fb
commit 2593b371d5
7 changed files with 14 additions and 8 deletions

View File

@@ -5,13 +5,13 @@ import type { CalendarCourseCellProps } from '@views/components/calendar/Calenda
import useSchedules from './useSchedules';
const dayToNumber: { [day: string]: number } = {
const dayToNumber = {
Monday: 0,
Tuesday: 1,
Wednesday: 2,
Thursday: 3,
Friday: 4,
};
} as const satisfies Record<string, number>;
interface CalendarGridPoint {
dayIndex: number;

View File

@@ -47,7 +47,12 @@ export default function useSchedules(): [active: UserSchedule | null, schedules:
return [activeSchedule, schedules];
}
export async function switchSchedule(name: string) {
/**
* Switches the active schedule to the one with the specified name.
* @param name - The name of the schedule to switch to.
* @returns A promise that resolves when the active schedule has been switched.
*/
export async function switchSchedule(name: string): Promise<void> {
const schedules = await UserScheduleStore.get('schedules');
const activeIndex = schedules.findIndex(s => s.name === name);
await UserScheduleStore.set('activeIndex', activeIndex);