Skip to content

Commit

Permalink
Merge pull request #1999 from KhalisFoundation/dev
Browse files Browse the repository at this point in the history
Beta release v9.2.2
  • Loading branch information
Gauravjeetsingh authored Jul 12, 2024
2 parents 3c62036 + 3cab3dd commit 610de43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## New Updates

### 9.2.2 - ਊਨਾ Release _July 01, 2024_
### 9.2.2 - ਊਨਾ Release _July 15, 2024_

#### Misc. bug fix and other improvements
- Enhanced Bani Controller: Improved functionality when using the Bani Controller in a multipane workspace.
Expand Down
28 changes: 3 additions & 25 deletions www/main/viewer/Slide/Slide.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { useStoreActions, useStoreState } from 'easy-peasy';
import { useStoreState } from 'easy-peasy';
import { CSSTransition } from 'react-transition-group';

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

const { activeVerseId, disabledContent } = useStoreState((state) => state.navigator);
const { setDisabledContent } = useStoreActions((state) => state.navigator);
const { activeVerseId } = useStoreState((state) => state.navigator);
const [showVerse, setShowVerse] = useState(true);
const [orderMarkup, setOrderMarkup] = useState(null);

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

useEffect(() => {
setTimeout(() => {
if (activeVerseRef && activeVerseRef.current.className.includes('active-viewer-verse')) {
if (activeVerseRef && activeVerseRef.current?.className.includes('active-viewer-verse')) {
activeVerseRef.current.scrollIntoView({
behavior: 'smooth',
block: 'center',
});
}
}, 100);
if (verseObj && verseObj.Translations) {
const translations = JSON.parse(verseObj.Translations);

const translationMapping = {
'en.bdb': 'translation-english',
'es.sn': 'translation-spanish',
'hi.ss': 'translation-hindi',
};

const missingTranslations = Object.entries(translationMapping)
.filter(([key]) => {
const value = key.split('.').reduce((obj, k) => obj && obj[k], translations);
return !value || !value.trim();
})
// eslint-disable-next-line no-unused-vars
.map(([_, identifier]) => identifier);

if (JSON.stringify(disabledContent) !== JSON.stringify(missingTranslations)) {
setDisabledContent(missingTranslations);
}
}
}, [verseObj]);

useEffect(() => {
Expand Down

0 comments on commit 610de43

Please sign in to comment.