fix: impersonation, dashboard counter, logo lightbox, submission config, auth logs
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m12s

- Fix impersonation by bypassing useSession().update() loading gate with direct session POST
- Fix dashboard account counter defaulting to latest round with PASSED projects
- Add clickToEnlarge lightbox for project logos on admin detail page
- Remove submission eligibility config (all passed projects must upload)
- Suppress CredentialsSignin auth errors in production (minified name check)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 15:40:08 +01:00
parent fd2624f198
commit b7905a82e1
10 changed files with 117 additions and 102 deletions

View File

@@ -720,17 +720,34 @@ export const dashboardRouter = router({
orderBy: { sortOrder: 'asc' },
})
// Determine which round to show
// Determine which round to show — pick the latest round that has PASSED projects
let selectedRoundId = roundId
if (!selectedRoundId) {
// Pick latest active round, or if none, the most recently closed
const activeRound = allRounds.find(r => r.status === 'ROUND_ACTIVE')
if (activeRound) {
selectedRoundId = activeRound.id
// Find rounds that actually have PASSED projects (most useful default)
const roundsWithPassed = await ctx.prisma.projectRoundState.groupBy({
by: ['roundId'],
where: {
state: 'PASSED',
roundId: { in: allRounds.map(r => r.id) },
},
})
const passedRoundIds = new Set(roundsWithPassed.map(r => r.roundId))
// Pick the latest round (highest sortOrder) that has PASSED projects
const roundsWithPassedSorted = allRounds
.filter(r => passedRoundIds.has(r.id))
.sort((a, b) => b.sortOrder - a.sortOrder)
if (roundsWithPassedSorted.length > 0) {
selectedRoundId = roundsWithPassedSorted[0].id
} else {
const closedRounds = allRounds.filter(r => r.status === 'ROUND_CLOSED' || r.status === 'ROUND_ARCHIVED')
if (closedRounds.length > 0) {
selectedRoundId = closedRounds[closedRounds.length - 1].id
// Fallback: active round, then most recently closed
const activeRound = allRounds.find(r => r.status === 'ROUND_ACTIVE')
if (activeRound) {
selectedRoundId = activeRound.id
} else {
const closedRounds = allRounds.filter(r => r.status === 'ROUND_CLOSED' || r.status === 'ROUND_ARCHIVED')
if (closedRounds.length > 0) {
selectedRoundId = closedRounds[closedRounds.length - 1].id
}
}
}
}