chore: lint and format repo - 1 lint error left
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user