18 lines
599 B
JavaScript
18 lines
599 B
JavaScript
import { defineNuxtPlugin } from "#app";
|
|
import { useAuth, useApi } from "~/lib/auth.js";
|
|
import { t as useSiteConfig } from "~/lib/useSiteConfig.js";
|
|
import { t as useNavigation } from "~/lib/navigation-state.js";
|
|
|
|
export default defineNuxtPlugin({
|
|
name: "console-bootstrap",
|
|
dependsOn: ["console-ui"],
|
|
async setup() {
|
|
const auth = useAuth();
|
|
const tasks = [useSiteConfig().load()];
|
|
if (auth.isLoggedIn && window.location.pathname !== "/home.htm") {
|
|
tasks.push(useNavigation(auth, useApi()).load(), auth.fetchOverview());
|
|
}
|
|
await Promise.allSettled(tasks);
|
|
},
|
|
});
|