Просмотр исходного кода

added check of compilation result status before setting pdfUrl/pdfDownloadUrl (#5697)

GitOrigin-RevId: ebf78bc2f98a952411875740fe912e275f83b224
Miguel Serrano 5 лет назад
Родитель
Сommit
8b85ef36eb
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      services/web/frontend/js/shared/context/compile-context.js

+ 4 - 2
services/web/frontend/js/shared/context/compile-context.js

@@ -229,10 +229,12 @@ export function CompileProvider({ children }) {
           setLogEntryAnnotations(
             buildLogEntryAnnotations(result.logEntries.all, ide.fileTreeManager)
           )
+          if (data.status === 'success') {
+            setPdfDownloadUrl(result.pdfDownloadUrl)
+            setPdfUrl(result.pdfUrl)
+          }
           setLogEntries(result.logEntries)
           setFileList(result.fileList)
-          setPdfDownloadUrl(result.pdfDownloadUrl)
-          setPdfUrl(result.pdfUrl)
           setRawLog(result.log)
 
           // sample compile stats for real users