Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: install router after data fetched (#2480)

boojack990d251bb7d0
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 83f695a1ae..4c9a405f03 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -130,11 +130,7 @@ app
// The normal hljs.initHighlightingOnLoad() won't work because router change would cause vue
// to re-render the page and remove the event listener required for
.directive("data-source-type", dataSourceType)
- .use(highlight)
- .use(pinia)
- .use(router)
- .use(i18n)
- .use(NaiveUI);
+ .use(pinia);
// We need to restore the basic info in order to perform route authentication.
// Even using the <suspense>, it's still too late, thus we do the fetch here.
@@ -152,6 +148,8 @@ const restoreUser = () => {
return authStore.restoreUser();
};
Promise.all([initActuator(), initSubscription(), restoreUser()]).finally(() => {
+ // Install router after the necessary data fetching is complete.
+ app.use(router).use(highlight).use(i18n).use(NaiveUI);
app.mount("#app");
// Try to mount demo vue app instance
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index b280f0c0b9..194b15812a 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -58,8 +58,6 @@ const ACTIVATE_MODULE = "auth.activate";
const PASSWORD_RESET_MODULE = "auth.password.reset";
const PASSWORD_FORGOT_MODULE = "auth.password.forgot";
-// console.log(useProjectWebhookStore());
-
const routes: Array<RouteRecordRaw> = [
{
path: "/auth",