fix: sync reorder transaction + redirect unauthenticated users to wishlist
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user