Skip to content

Commit

Permalink
Merge pull request #1978 from Gauravjeetsingh/minor-issues
Browse files Browse the repository at this point in the history
Alpha QA issues
  • Loading branch information
Gauravjeetsingh authored Jun 17, 2024
2 parents ed07d29 + ceaf7b7 commit 0ebab2a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion www/main/addons/announcement/components/Annoucement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const Announcement = ({ isGurmukhi }) => {
<textarea
className={classNames(
'announcement-text',
keyboardOpenStatus && 'gurmukhi',
keyboardOpenStatus && isGurmukhi && 'gurmukhi',
isGurmukhi && 'gurmukhi',
'disable-kb-shortcuts',
)}
Expand Down
4 changes: 2 additions & 2 deletions www/main/addons/ceremonies/components/CeremonyPane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => {
current: getTheme(currentTheme),
};

const openCeremonyFromDropdown = (givenPane) => {
onThemeClick(paneSelector.current.dataset.theme, givenPane);
const openCeremonyFromDropdown = (e, givenPane) => {
onThemeClick(e, paneSelector.current.dataset.theme, givenPane);
setPaneSelectorActive(false);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const MultipaneDropdown = ({
const dropdownOptions = [pane1, pane2, pane3].map((item, index) => (
<p
key={`pane-option-${index + 1}`}
onClick={() => {
onClick={(e) => {
if (!item.locked) {
clickHandler(index + 1);
clickHandler(e, index + 1);
}
}}
title={item.locked ? i18n.t('MULTI_PANE.LOCKED_PANE_MSG') : ''}
Expand Down
6 changes: 2 additions & 4 deletions www/main/navigator/shabad/ShabadContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,8 @@ const ShabadContent = () => {
loadCeremony(ceremonyId).then((ceremonyVerses) => {
if (ceremonyVerses) {
setActiveShabad(ceremonyVerses);
const newEntry = saveToHistory(ceremonyVerses, 'ceremony');
if (newEntry) {
openFirstVerse(ceremonyVerses[0].ID, ceremonyVerses[0].crossPlatformID);
}
saveToHistory(ceremonyVerses, 'ceremony');
openFirstVerse(ceremonyVerses[0].ID, ceremonyVerses[0].crossPlatformID);
}
});
} else {
Expand Down
7 changes: 5 additions & 2 deletions www/main/navigator/shabad/ShabadText.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const ShabadText = ({
initialVerseId,
);
setFilteredItems(filterRequiredVerseItems(verseList));
updateTraversedVerse(verseList[0].ID, 0);
}
});
}
Expand Down Expand Up @@ -213,8 +214,10 @@ export const ShabadText = ({
activeVerse: activeVerseId,
});
const verseIndex = filteredItems.findIndex((verse) => verse.verseId === activeVerseId);
if (verseIndex >= 0) setActiveVerse({ [verseIndex]: activeVerseId });
scrollToVerse(activeVerseId, filteredItems, virtuosoRef);
if (verseIndex >= 0 && activeVerseId !== 61 && filteredItems[verseIndex].verse !== ',') {
setActiveVerse({ [verseIndex]: activeVerseId });
scrollToVerse(activeVerseId, filteredItems, virtuosoRef);
}
}
}, [activeShabadId, activeVerseId, sundarGutkaBaniId, ceremonyId]);

Expand Down
13 changes: 8 additions & 5 deletions www/main/navigator/shabad/utils/scroll-to-verse.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export const scrollToVerse = (verseId, activeShabad, virtuosoRef) => {
const verseIndex = activeShabad.findIndex((obj) => obj.verseId === verseId);
virtuosoRef.current.scrollToIndex({
index: verseIndex,
behavior: 'smooth',
align: 'center',
});
// Ignoring flower verse to avoid unwanted scroll during asa di vaar
if (verseIndex >= 0 && verseId !== 61 && activeShabad[verseIndex].verse !== ',') {
virtuosoRef.current.scrollToIndex({
index: verseIndex,
behavior: 'smooth',
align: 'center',
});
}
};
17 changes: 10 additions & 7 deletions www/obs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,16 @@

document.body.style.backgroundColor = overlayColor;

const $gurbani = document.querySelector('.o-gurbani');
const { overlayLarivaar, larivaarAssist } = overlayPrefs;
let line = '';
if ($gurbani.children.length) {
line = [...$gurbani.children].map(word => word.innerHTML).join(' ');
}
$gurbani.innerHTML = assist(line, overlayLarivaar, larivaarAssist);
const $gurbaniWrapper = document.querySelectorAll('.o-gurbani');

$gurbaniWrapper.forEach($gurbani => {
let line = '';
const { overlayLarivaar, larivaarAssist } = overlayPrefs;
if ($gurbani.children.length) {
line = [...$gurbani.children].map(word => word.innerHTML).join(' ');
}
$gurbani.innerHTML = assist(line, overlayLarivaar, larivaarAssist);
});
};

socket.on('show-line', request => {
Expand Down

0 comments on commit 0ebab2a

Please sign in to comment.