Skip to content

Commit

Permalink
Merge pull request #2049 from quran/fix-translations-always-showing-bug
Browse files Browse the repository at this point in the history
Force-remove translations depending on user preferences
  • Loading branch information
osamasayed authored Nov 29, 2023
2 parents 3f8eb0e + b1ee61f commit 9bb28d5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,16 @@ const useDedupedFetchVerse = ({
)
: null;

const verse = verses ? verses[idxInPage] : null;

// This part handles an edge case where the user has no selected translations but the `initialData` sent from server-side rendering has a default translation.
// So, we need to remove the translations from the verse if the user has no selected translations.
if (verse && selectedTranslations.length === 0) {
verse.translations = [];
}

return {
verse: verses ? verses[idxInPage] : null,
verse,
firstVerseInPage: verses ? verses[0] : null,
bookmarksRangeUrl,
notesRange: verses
Expand Down

0 comments on commit 9bb28d5

Please sign in to comment.