fix: sync reorder transaction + redirect unauthenticated users to wishlist
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled

- reorder route used async callback with better-sqlite3 (sync driver),
  causing "Transaction function cannot return a promise" — converted to sync
- home page now redirects unauthenticated visitors to the wishlist slug
  instead of getting stuck on the loading screen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Adriano Belisario
2026-05-03 21:02:10 +00:00
parent 2726be337e
commit 23114637ac
2 changed files with 13 additions and 8 deletions

View File

@@ -37,7 +37,11 @@ export default function HomePage() {
}
return;
}
// Unauthenticated — show a simple landing
// Unauthenticated — redirect to wishlist anyway (GuestGuard will block them there)
const lists = await wishlistsApi.getAllPublic();
if (!cancelled && lists.length > 0) {
router.replace(`/${lists[0].slug}`);
}
} catch {
// ignore
}