Fix contact form crash, analytics range filter, Scripture Index parsing, and unsafe-delete UI bugs
Publish Container / docker (push) Successful in 13m12s
Publish Container / docker (push) Successful in 13m12s
- server/routes/contact.js: import fireWebhooks (was undefined, throwing on every submission) - server/routes/analytics.js: filter admin-stats by row.at, the field recordVisitor actually sets, instead of the never-populated row.visitedAt - src/App.tsx: parseSIRef now supports chapter-spanning verse ranges (e.g. "5:15-6:2"); SI_BOOK_MAP indexes both spaced and unspaced book names so multi-word Bible Book values from the admin field resolve correctly - src/App.css / src/App.tsx: fix Episodes/Studies nav dropdown menus being unclickable — a positioning gap between the trigger and menu created a hover dead zone; menu is now flush with spacing moved into padding so hover carries through - src/components/StudySectionComments.tsx: check response status before removing a comment locally, so a rejected delete no longer appears to succeed - src/components/QASection.tsx: don't bail out of search scoring for 1-2 character queries, so short substrings like "OT" or "AI" can still match - src/AdminPage.tsx: check response status in study-user, QR code, and episode-script delete handlers before updating local state Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Yvx4rPVy2HWe7ubuk3X3J
This commit is contained in:
1 parent
6ed29ea527
commit
c158fb6317
7 files changed
+76
-27
No files matched your search
@@ -349,8 +349,10 @@ function semanticScoreForQuestion(question: PublicQuestion, tags: string[], quer
|
||||
const normalized = query.trim().toLowerCase()
|
||||
if (!normalized) return 0
|
||||
|
||||
// Note: tokenize() drops tokens of length <= 2 (e.g. "OT", "AI"), so queryTokens can be
|
||||
// empty for short queries — fall through to the substring checks below rather than
|
||||
// bailing out, so short queries can still match via direct substring inclusion.
|
||||
const queryTokens = tokenize(normalized)
|
||||
if (queryTokens.length === 0) return 0
|
||||
|
||||
const expanded = expandQueryTokens(queryTokens)
|
||||
const questionTokens = new Set(tokenize(`${question.question} ${question.answer} ${question.topic ?? ''} ${tags.join(' ')}`))
|
||||
|
||||
@@ -71,10 +71,14 @@ export function StudySectionComments({ studySlug, sectionId, isEnrolled }: Props
|
||||
async function handleDelete(commentId: string) {
|
||||
setDeletingId(commentId)
|
||||
try {
|
||||
await fetch(`/api/study-comments/${commentId}`, { method: 'DELETE' })
|
||||
const res = await fetch(`/api/study-comments/${commentId}`, { method: 'DELETE' })
|
||||
if (!res.ok) {
|
||||
setError('Could not delete that comment.')
|
||||
return
|
||||
}
|
||||
setComments(prev => prev.filter(c => c.id !== commentId))
|
||||
} catch {
|
||||
// ignore
|
||||
setError('Network error. Please try again.')
|
||||
} finally {
|
||||
setDeletingId(null)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user