Skip to content

Commit

Permalink
fix: clear current course
Browse files Browse the repository at this point in the history
  • Loading branch information
jouwdan committed Aug 5, 2023
1 parent 44f46a9 commit 6167b85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/web/src/lib/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const revealSidebar = writable(false);
export const revealOnline = writable(false);
export const week = writable(weekType);
export const courseUrl = writable('');
export const currentCourse: Writable<Course> = writable();
export const currentCourse: Writable<Course | null> = writable();
export const currentLo: Writable<Lo> = writable();
export const currentUser: Writable<User> = writable();
export const portfolio = writable(false);
Expand Down
6 changes: 6 additions & 0 deletions apps/web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
drawerStore.open(settings);
};
page.subscribe((value) => {
if (value.url.pathname.startsWith('/dashboard') || value.url.pathname.length === 1) {
currentCourse.set(null);
}
});
onMount(() => {
const {
data: { subscription }
Expand Down

0 comments on commit 6167b85

Please sign in to comment.