Fix some linting errors and warnings
This commit is contained in:
parent
f58b2f6303
commit
a4a93a2214
|
|
@ -7,7 +7,7 @@ import type { LearningPath } from "@/services/learningPath";
|
|||
import { useCockpitStore } from "@/stores/cockpit";
|
||||
import { useCompetenceStore } from "@/stores/competence";
|
||||
import { useLearningPathStore } from "@/stores/learningPath";
|
||||
import * as log from "loglevel";
|
||||
import log from "loglevel";
|
||||
|
||||
const props = defineProps<{
|
||||
courseSlug: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useUserStore } from "@/stores/user";
|
||||
import type { NavigationGuardWithThis, RouteLocationNormalized } from "vue-router";
|
||||
|
||||
export const updateLoggedIn: NavigationGuardWithThis<undefined> = async (_to) => {
|
||||
export const updateLoggedIn: NavigationGuardWithThis<undefined> = async () => {
|
||||
const loggedIn = getCookieValue("loginStatus") === "true";
|
||||
const userStore = useUserStore();
|
||||
|
||||
|
|
@ -11,10 +11,7 @@ export const updateLoggedIn: NavigationGuardWithThis<undefined> = async (_to) =>
|
|||
}
|
||||
};
|
||||
|
||||
export const redirectToLoginIfRequired: NavigationGuardWithThis<undefined> = (
|
||||
to,
|
||||
_from
|
||||
) => {
|
||||
export const redirectToLoginIfRequired: NavigationGuardWithThis<undefined> = (to) => {
|
||||
const userStore = useUserStore();
|
||||
if (loginRequired(to) && !userStore.loggedIn) {
|
||||
return `/login?next=${to.fullPath}`;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ const router = createRouter({
|
|||
router.beforeEach(updateLoggedIn);
|
||||
router.beforeEach(redirectToLoginIfRequired);
|
||||
|
||||
router.afterEach((to, from) => {
|
||||
router.afterEach(() => {
|
||||
const appStore = useAppStore();
|
||||
appStore.routingFinished = true;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { itGetCached } from "@/fetchHelpers";
|
||||
import type { CircleExpert, Course, CourseSession } from "@/types";
|
||||
import type { CourseSession } from "@/types";
|
||||
import _ from "lodash";
|
||||
import log from "loglevel";
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export const useUserStore = defineStore({
|
|||
handleLogout() {
|
||||
Object.assign(this, initialUserState);
|
||||
|
||||
itPost("/api/core/logout/", {}).then((data) => {
|
||||
itPost("/api/core/logout/", {}).then(() => {
|
||||
let redirectUrl;
|
||||
|
||||
if (logoutRedirectUrl !== "") {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
export function assertUnreachable(x: never): never {
|
||||
export function assertUnreachable(): never {
|
||||
throw new Error("Didn't expect to get here");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue