This commit is contained in:
Viet An
2026-07-09 17:22:19 +07:00
parent 9b77644e8d
commit 22854bb4fb
9 changed files with 104 additions and 77 deletions

View File

@@ -1,5 +1,4 @@
export default defineNuxtPlugin((nuxtApp) => {
const store = useStore();
export default defineNuxtPlugin(async (nuxtApp) => {
const { $getapi, $readyapi } = nuxtApp;
const connlist = $readyapi([
"common",
@@ -19,7 +18,6 @@ export default defineNuxtPlugin((nuxtApp) => {
async function getReady() {
try {
await $getapi(notReadyConns);
store.ready = true;
} catch (error) {
showError({
statusCode: 500,
@@ -27,5 +25,5 @@ export default defineNuxtPlugin((nuxtApp) => {
});
}
}
if (notReadyConns.length > 0) getReady();
if (notReadyConns.length > 0) await getReady();
});