Álvaro Valenzuela Valdes commited on
Commit ·
29a7a62
1
Parent(s): ecc5ffa
fix: Scroll to top on tab change and add detailed backend logs
Browse files- backend/app/main.py +3 -0
- frontend/app/page.tsx +5 -0
backend/app/main.py
CHANGED
|
@@ -30,9 +30,12 @@ app.include_router(documents.router, prefix="/api", tags=["Documents"])
|
|
| 30 |
|
| 31 |
@app.on_event("startup")
|
| 32 |
async def startup_event():
|
|
|
|
| 33 |
db = SessionLocal()
|
| 34 |
try:
|
|
|
|
| 35 |
count = db.query(TenderModel).count()
|
|
|
|
| 36 |
if count == 0:
|
| 37 |
print("Auto-seeding database...")
|
| 38 |
# Basic Company Profile
|
|
|
|
| 30 |
|
| 31 |
@app.on_event("startup")
|
| 32 |
async def startup_event():
|
| 33 |
+
print("!!! BACKEND STARTING UP !!!")
|
| 34 |
db = SessionLocal()
|
| 35 |
try:
|
| 36 |
+
print(f"Checking database at: {settings.database_url}")
|
| 37 |
count = db.query(TenderModel).count()
|
| 38 |
+
print(f"Current tender count: {count}")
|
| 39 |
if count == 0:
|
| 40 |
print("Auto-seeding database...")
|
| 41 |
# Basic Company Profile
|
frontend/app/page.tsx
CHANGED
|
@@ -47,6 +47,11 @@ export default function HomePage() {
|
|
| 47 |
const [analysisHistory, setAnalysisHistory] = useState<AnalysisHistoryItem[]>([]);
|
| 48 |
const [status, setStatus] = useState("listening");
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
useEffect(() => {
|
| 51 |
if (typeof window !== 'undefined') {
|
| 52 |
const params = new URLSearchParams(window.location.search);
|
|
|
|
| 47 |
const [analysisHistory, setAnalysisHistory] = useState<AnalysisHistoryItem[]>([]);
|
| 48 |
const [status, setStatus] = useState("listening");
|
| 49 |
|
| 50 |
+
// Scroll to top when tab changes
|
| 51 |
+
useEffect(() => {
|
| 52 |
+
window.scrollTo(0, 0);
|
| 53 |
+
}, [activeTab]);
|
| 54 |
+
|
| 55 |
useEffect(() => {
|
| 56 |
if (typeof window !== 'undefined') {
|
| 57 |
const params = new URLSearchParams(window.location.search);
|