Study guide button downloads the file directly with no name/email form; v2.36.1
Publish Container / build (push) Successful in 15m3s
Publish Container / build (push) Successful in 15m3s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fed2b6bacc
commit
753b5c77cf
4 files changed
+11
-7
No files matched your search
+5
-3
@@ -710,6 +710,8 @@ export interface StudyGuideLink {
|
||||
// Page id under /downloads/ (primary-guide, second-guide, book-guide--<id>)
|
||||
pageId: string
|
||||
title: string
|
||||
// Direct file link, when the guide has one; otherwise the button opens the guide's page (store links)
|
||||
downloadUrl?: string
|
||||
}
|
||||
|
||||
// The companion guide a study offers, either chosen explicitly in admin or found through the
|
||||
@@ -723,13 +725,13 @@ export function getStudyGuideLink(
|
||||
|
||||
const primary = (): StudyGuideLink | null =>
|
||||
content.studyGuideTitle && (content.studyGuideUrl || content.studyGuideDownloadUrl || content.studyGuideAppleBooksUrl)
|
||||
? { pageId: 'primary-guide', title: content.studyGuideTitle }
|
||||
? { pageId: 'primary-guide', title: content.studyGuideTitle, downloadUrl: content.studyGuideDownloadUrl || undefined }
|
||||
: null
|
||||
const second = (): StudyGuideLink | null =>
|
||||
content.secondSeries?.guide?.title ? { pageId: 'second-guide', title: content.secondSeries.guide.title } : null
|
||||
content.secondSeries?.guide?.title ? { pageId: 'second-guide', title: content.secondSeries.guide.title, downloadUrl: content.secondSeries.guide.downloadUrl || undefined } : null
|
||||
const book = (id: string): StudyGuideLink | null => {
|
||||
const found = (content.finishedBooks ?? []).find(b => b.id === id)
|
||||
return found?.guide?.title ? { pageId: `book-guide--${found.id}`, title: found.guide.title } : null
|
||||
return found?.guide?.title ? { pageId: `book-guide--${found.id}`, title: found.guide.title, downloadUrl: found.guide.downloadUrl || undefined } : null
|
||||
}
|
||||
|
||||
if (source === 'primary') return primary()
|
||||
|
||||
Reference in new issue
Block a user