Skip to content

Commit 1e87d12

Browse files
Merge pull request #1997 from Gauravjeetsingh/akv-bug
Revert the disabled content functionality
2 parents d780d29 + 3174ac7 commit 1e87d12

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

www/main/viewer/Slide/Slide.jsx

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useRef, useState } from 'react';
22
import PropTypes from 'prop-types';
3-
import { useStoreActions, useStoreState } from 'easy-peasy';
3+
import { useStoreState } from 'easy-peasy';
44
import { CSSTransition } from 'react-transition-group';
55

66
import SlideTeeka from './SlideTeeka';
@@ -28,8 +28,7 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => {
2828
content3Visibility,
2929
} = useStoreState((state) => state.userSettings);
3030

31-
const { activeVerseId, disabledContent } = useStoreState((state) => state.navigator);
32-
const { setDisabledContent } = useStoreActions((state) => state.navigator);
31+
const { activeVerseId } = useStoreState((state) => state.navigator);
3332
const [showVerse, setShowVerse] = useState(true);
3433
const [orderMarkup, setOrderMarkup] = useState(null);
3534

@@ -63,34 +62,13 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => {
6362

6463
useEffect(() => {
6564
setTimeout(() => {
66-
if (activeVerseRef && activeVerseRef.current.className.includes('active-viewer-verse')) {
65+
if (activeVerseRef && activeVerseRef.current?.className.includes('active-viewer-verse')) {
6766
activeVerseRef.current.scrollIntoView({
6867
behavior: 'smooth',
6968
block: 'center',
7069
});
7170
}
7271
}, 100);
73-
if (verseObj && verseObj.Translations) {
74-
const translations = JSON.parse(verseObj.Translations);
75-
76-
const translationMapping = {
77-
'en.bdb': 'translation-english',
78-
'es.sn': 'translation-spanish',
79-
'hi.ss': 'translation-hindi',
80-
};
81-
82-
const missingTranslations = Object.entries(translationMapping)
83-
.filter(([key]) => {
84-
const value = key.split('.').reduce((obj, k) => obj && obj[k], translations);
85-
return !value || !value.trim();
86-
})
87-
// eslint-disable-next-line no-unused-vars
88-
.map(([_, identifier]) => identifier);
89-
90-
if (JSON.stringify(disabledContent) !== JSON.stringify(missingTranslations)) {
91-
setDisabledContent(missingTranslations);
92-
}
93-
}
9472
}, [verseObj]);
9573

9674
useEffect(() => {

0 commit comments

Comments
 (0)