@@ -117,7 +117,11 @@ const MeetingDetails: React.FC = () => {
117117 void shareMeetingPublicUrl ( meeting . id ) ;
118118 } , [ meeting ] ) ;
119119
120- const { transcriptions } = useAppSelector ( ( state ) => state . transcription ) ;
120+ const transcriptions = useAppSelector ( ( state ) =>
121+ meeting ?. status === MeetingStatus . ENDED
122+ ? state . transcription . transcriptions . items
123+ : [ ] ,
124+ ) ;
121125
122126 if ( ! id || dataStatus === DataStatus . REJECTED ) {
123127 return < Navigate replace to = { AppRoute . NOT_FOUND } /> ;
@@ -135,7 +139,7 @@ const MeetingDetails: React.FC = () => {
135139 ) ;
136140 }
137141
138- const transcription = transcriptions . items
142+ const transcription = transcriptions
139143 . map ( ( item ) => `• ${ item . chunkText } ` )
140144 . join ( "\n" ) ;
141145
@@ -150,7 +154,7 @@ const MeetingDetails: React.FC = () => {
150154 } ;
151155
152156 const isMeetingEnded = meeting . status === MeetingStatus . ENDED ;
153- const hasTranscript = transcriptions . items . length > EMPTY_ARRAY_LENGTH ;
157+ const hasTranscript = transcriptions . length > EMPTY_ARRAY_LENGTH ;
154158 const hasSummary = Boolean ( meeting . summary ?. trim ( ) ) ;
155159 const hasActionItems = Boolean ( meeting . actionItems ?. trim ( ) ) ;
156160
@@ -192,18 +196,22 @@ const MeetingDetails: React.FC = () => {
192196 />
193197 ) }
194198
195- < PDFDownloadLink
196- document = { < MeetingPdf { ...meetingPdfProperties } /> }
197- fileName = { pdfFileName }
198- key = { isMeetingEnded ? "pdf-ready" : "pdf-pending" }
199- >
200- { ( { loading } ) => (
201- < Button
202- isDisabled = { ! canExport }
203- label = { loading ? "Generating PDF..." : "Export" }
204- />
205- ) }
206- </ PDFDownloadLink >
199+ { isMeetingEnded ? (
200+ < PDFDownloadLink
201+ document = { < MeetingPdf { ...meetingPdfProperties } /> }
202+ fileName = { pdfFileName }
203+ key = "pdf-ready"
204+ >
205+ { ( { loading } ) => (
206+ < Button
207+ isDisabled = { ! canExport }
208+ label = { loading ? "Generating PDF..." : "Export" }
209+ />
210+ ) }
211+ </ PDFDownloadLink >
212+ ) : (
213+ < Button isDisabled label = "Export" />
214+ ) }
207215 </ div >
208216 </ div >
209217
0 commit comments