diff --git a/apps/web/src/app/(portal)/admin/modules/page.tsx b/apps/web/src/app/(portal)/admin/modules/page.tsx index fa7ad70..2a41422 100644 --- a/apps/web/src/app/(portal)/admin/modules/page.tsx +++ b/apps/web/src/app/(portal)/admin/modules/page.tsx @@ -3,6 +3,7 @@ import { useCallback, useEffect, useState } from 'react'; import { useTranslations } from 'next-intl'; import { useAuthStore } from '@/lib/stores/auth-store'; +import { useMarketplaceStore } from '@/lib/stores/marketplace-store'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3001'; @@ -27,6 +28,11 @@ export default function AdminModulesPage() { const t = useTranslations('adminModules'); const tCommon = useTranslations('common'); const currentUser = useAuthStore((s) => s.user); + // Shared signal that makes the sidebar refetch its active-module list + // (same mechanism the marketplace pages use). Without bumping this after a + // toggle here, an activation from the admin page only updates local state — + // the sidebar link would not appear until a full page reload. + const bumpSidebarRefresh = useMarketplaceStore((s) => s.bumpSidebarRefresh); const [modules, setModules] = useState([]); const [activations, setActivations] = useState>(new Map()); @@ -91,6 +97,9 @@ export default function AdminModulesPage() { } return next; }); + // Refresh the sidebar so the (de)activated module's link appears/ + // disappears immediately, without a manual full page reload. + bumpSidebarRefresh(); } else { const body = await res.text().catch(() => ''); setError(`${res.status}: ${body}`);