diff --git a/src/components/DAKDashboard.js b/src/components/DAKDashboard.js index 39364262e..80746f489 100644 --- a/src/components/DAKDashboard.js +++ b/src/components/DAKDashboard.js @@ -506,7 +506,8 @@ const DAKDashboardContent = () => { ); } - if (!profile || !repository) { + // Only redirect if we're not loading and still don't have required data + if (!loading && (!profile || !repository)) { navigate('/'); return
Redirecting...
; } diff --git a/src/components/framework/PageProvider.js b/src/components/framework/PageProvider.js index 73d059469..1d7b8c28c 100644 --- a/src/components/framework/PageProvider.js +++ b/src/components/framework/PageProvider.js @@ -120,6 +120,9 @@ export const PageProvider = ({ children, pageName }) => { let profile = location.state?.profile; let repository = location.state?.repository; let selectedBranch = location.state?.selectedBranch || params.branch || urlContext.branch; + + // Track if we have repository from navigation state to skip re-fetching + const hasRepositoryFromState = Boolean(repository && repository.name && repository.owner); // For DAK and Asset pages, validate and fetch data if (pageState.type === PAGE_TYPES.DAK || pageState.type === PAGE_TYPES.ASSET) { @@ -160,7 +163,8 @@ export const PageProvider = ({ children, pageName }) => { } } - if (!repository && effectiveUser && effectiveRepo) { + // Only fetch repository if not provided via navigation state + if (!hasRepositoryFromState && !repository && effectiveUser && effectiveRepo) { if (githubService.isAuth()) { try { repository = await githubService.getRepository(effectiveUser, effectiveRepo);