Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .changeset/ten-candles-ask.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion conductor.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
}
],
"scripts": {
"setup": "git config core.hooksPath .husky && npm install && uv sync && docker compose up -d postgres && sleep 2 && DB_PORT=$(docker compose port postgres 5432 | cut -d: -f2) && APP_PORT=$((50000 + RANDOM % 10000)) && echo \"DATABASE_URL=postgresql://adcp:localdev@localhost:$DB_PORT/adcp_registry\" >> .env.local && echo \"DATABASE_SSL=false\" >> .env.local && echo \"CONDUCTOR_PORT=$APP_PORT\" >> .env.local && npm run db:migrate"
"setup": "git config core.hooksPath .husky && npm install && uv sync && open -a Docker && sleep 5 && docker compose up -d postgres && sleep 2 && DB_PORT=$(docker compose port postgres 5432 | cut -d: -f2) && APP_PORT=$((50000 + RANDOM % 10000)) && echo \"DATABASE_URL=postgresql://adcp:localdev@localhost:$DB_PORT/adcp_registry\" >> .env.local && echo \"DATABASE_SSL=false\" >> .env.local && echo \"CONDUCTOR_PORT=$APP_PORT\" >> .env.local && npm run db:migrate"
}
}
16 changes: 11 additions & 5 deletions server/public/admin-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,17 @@
injectNavigation();
}

// Auto-initialize
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
// Auto-initialize only on admin pages
function shouldInitialize() {
return window.location.pathname.startsWith('/admin');
}

if (shouldInitialize()) {
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
}

// Utility function to redirect to login with return_to parameter
Expand Down