This commit is contained in:
Viet An
2026-06-11 17:25:44 +07:00
parent 069ea1002c
commit a1450c7bde
4 changed files with 75 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
export default defineNuxtPlugin(async (nuxtApp) => {
export default defineNuxtPlugin((nuxtApp) => {
const store = useStore();
const { $getapi, $readyapi } = nuxtApp;
const connlist = $readyapi([
"common",
@@ -18,5 +19,10 @@ export default defineNuxtPlugin(async (nuxtApp) => {
"colorscheme",
]);
const notReadyConns = connlist.filter((v) => !v.ready);
if (notReadyConns.length > 0) await $getapi(notReadyConns);
async function getReady() {
await $getapi(notReadyConns);
store.ready = true;
}
if (notReadyConns.length > 0) getReady();
});