Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/DAKDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <div>Redirecting...</div>;
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/framework/PageProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down