diff --git a/web/ts/components/course.ts b/web/ts/components/course.ts index edc91bf2c..b018d8420 100644 --- a/web/ts/components/course.ts +++ b/web/ts/components/course.ts @@ -124,11 +124,10 @@ export function courseContext(slug: string, year: number, term: string, userId: }, toggleListView() { - if (this.viewMode == ViewMode.Grid) { - this.viewMode = ViewMode.List; - } else { - this.viewMode = ViewMode.Grid; - } + this.viewMode = + this.viewMode === ViewMode.Grid + ? ViewMode.List + : ViewMode.Grid; setInStorage("viewMode", this.viewMode.toString()); },