From 9d2176ef05c26ceb77d3bb8b939c53d91c1e8a93 Mon Sep 17 00:00:00 2001 From: sijumoncy <72241997+sijumoncy@users.noreply.github.com> Date: Fri, 5 Jan 2024 09:25:44 +0530 Subject: [PATCH] added fix for infinite loading --- .../EditorPage/Reference/TranslationHelpsCard.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/renderer/src/components/EditorPage/Reference/TranslationHelpsCard.js b/renderer/src/components/EditorPage/Reference/TranslationHelpsCard.js index f7592104f..5938319d8 100644 --- a/renderer/src/components/EditorPage/Reference/TranslationHelpsCard.js +++ b/renderer/src/components/EditorPage/Reference/TranslationHelpsCard.js @@ -105,6 +105,7 @@ export default function TranslationHelpsCard({ }; }).filter((data) => data.Chapter === chapter && data.Verse === verse); setOfflineItemsDisable(false); + console.log({ json }); setOfflineItems(json); } } @@ -178,7 +179,7 @@ export default function TranslationHelpsCard({ setOfflineItemsDisable(true); setOfflineMarkdown(filecontent); } else { - setOfflineMarkdown(''); + setOfflineMarkdown({ error: true, data: 'No Content Avaialble' }); } } }); @@ -192,6 +193,8 @@ export default function TranslationHelpsCard({ const filecontent = fs.readFileSync(path.join(folder, projectName, projectId, filePath), 'utf8'); setOfflineItemsDisable(true); setOfflineMarkdown(filecontent); + } else { + setOfflineMarkdown({ error: true, data: 'No Content Available' }); } break; @@ -202,6 +205,8 @@ export default function TranslationHelpsCard({ const filecontent = fs.readFileSync(path.join(folder, projectName, 'bible', filePath), 'utf8'); setOfflineItemsDisable(true); setOfflineMarkdown(filecontent); + } else { + setOfflineMarkdown({ error: true, data: 'No Content Available' }); } break; @@ -221,6 +226,10 @@ export default function TranslationHelpsCard({ items = !offlineItemsDisable && offlineResource?.offline ? offlineItems : items; markdown = offlineResource?.offline ? offlineMarkdown : markdown; + console.log({ + markdown, isLoading, items, offlineMarkdown, offlineItems, +}); + return ( (markdown || items) ? (