Fix module-level store init in files.js, apiError.js, cytoscapeMap.js and add files store tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import router from "@/router/index.ts";
|
||||
import loadingStore from '@/stores/loading.js';
|
||||
import pinia from '@/stores/main.ts';
|
||||
import {useToast} from 'vue-toast-notification';
|
||||
import 'vue-toast-notification/dist/theme-sugar.css';
|
||||
import axios from "axios";
|
||||
import { deleteCookie } from "@/utils/cookieUtil.js";
|
||||
|
||||
const loading = loadingStore(pinia);
|
||||
const $toast = useToast();
|
||||
// Delay loading and toast
|
||||
const delay = (s = 0) => new Promise((resolve, reject) => setTimeout(resolve, s));
|
||||
|
||||
@@ -23,6 +20,8 @@ export default async function apiError(error, toastMessage) {
|
||||
deleteCookie("luciaToken");
|
||||
return router.push('/login');
|
||||
}
|
||||
const loading = loadingStore();
|
||||
const $toast = useToast();
|
||||
await delay();
|
||||
loading.isLoading = true;
|
||||
await delay(1000);
|
||||
|
||||
Reference in New Issue
Block a user