fix(auth): defer environment context fetch until token is available

This commit is contained in:
2026-02-25 20:58:14 +03:00
parent 4bad4ab4e2
commit 4d5b9e88dd
2 changed files with 27 additions and 10 deletions

View File

@@ -23,7 +23,6 @@
@INVARIANT: Login route bypasses shell; all other routes are wrapped by ProtectedRoute.
-->
<script>
import { onMount } from 'svelte';
import '../app.css';
import Navbar from '../components/Navbar.svelte';
import Footer from '../components/Footer.svelte';
@@ -36,7 +35,6 @@
import AssistantChatPanel from '$lib/components/assistant/AssistantChatPanel.svelte';
import { t } from '$lib/i18n';
import {
initializeEnvironmentContext,
isProductionContextStore,
selectedEnvironmentStore
} from '$lib/stores/environmentContext.js';
@@ -47,12 +45,6 @@
$: isExpanded = $sidebarStore?.isExpanded || true;
$: isProductionContext = $isProductionContextStore;
$: selectedEnvironment = $selectedEnvironmentStore;
onMount(async () => {
if (!isLoginPage) {
await initializeEnvironmentContext();
}
});
</script>
<Toast />