Skip to content

Commit

Permalink
Merge pull request #1971 from Gauravjeetsingh/minor-issues
Browse files Browse the repository at this point in the history
Code optimizations, Version update to 9.2.2
  • Loading branch information
Gauravjeetsingh authored Jun 14, 2024
2 parents 16b83d3 + 3bca7d2 commit 9bcbfb2
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 54 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
## New Updates

### 9.2.2 - ਊਨਾ Release _June 18, 2024_

#### Misc. bug fix and other improvements
- Enhanced Bani Controller: Improved functionality when using the Bani Controller in a multipane workspace.
- Improved Theme Handling: Enhanced support for custom images during theme changes.
- Restored Font Size Adjustments: Restored the ability to change the font size for miscellaneous slides such as "Waheguru" and "Mool Mantra."
- Code and Style Improvements: Various code refactors and stylistic enhancements to improve performance and maintainability.

**We would love to hear from you if there a feature that you have been waiting for. Send us your feedback at [sttm.co/feedback](https://www.sttm.co/feedback).**
</br>

### 9.2.1 - ਊਨਾ Release _May 24, 2024_

#### New Features
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"productName": "SikhiToTheMax",
"name": "sttm-desktop",
"version": "9.2.1",
"version": "9.2.2",
"description": "The SikhiToTheMax desktop app",
"main": "app.js",
"scripts": {
Expand Down Expand Up @@ -216,4 +216,4 @@
"NSAllowsArbitraryLoads": true
}
}
}
}
6 changes: 5 additions & 1 deletion www/main/navigator/shabad/ShabadText.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ export const ShabadText = ({
live: liveFeed,
}),
);
if ([activeShabadId, sundarGutkaBaniId, ceremonyId].includes(paneAttributes.activeShabad)) {
if (
(isCeremonyBani && ceremonyId === paneAttributes.activeShabad) ||
(isSundarGutkaBani && sundarGutkaBaniId === paneAttributes.activeShabad) ||
(!isSundarGutkaBani && !isCeremonyBani && activeShabadId === paneAttributes.activeShabad)
) {
setPaneAttributes({
...paneAttributes,
activeVerse: activeVerseId,
Expand Down
72 changes: 39 additions & 33 deletions www/main/navigator/shabad/utils/change-verse.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,46 @@ export const changeVerse = (
setIsCeremonyBani,
},
) => {
if (baniType === 'bani') {
if (clickedShabad !== sundarGutkaBaniId) {
setSundarGutkaBaniId(clickedShabad);
setPreviousIndex(null);
}
if (!isSundarGutkaBani) {
setIsSundarGutkaBani(true);
}
if (isCeremonyBani) {
setIsCeremonyBani(false);
}
} else if (baniType === 'ceremony') {
if (clickedShabad !== ceremonyId) {
setCeremonyId(clickedShabad);
setPreviousIndex(null);
}
switch (baniType) {
case 'bani':
if (clickedShabad !== sundarGutkaBaniId) {
setSundarGutkaBaniId(clickedShabad);
setPreviousIndex(null);
}
if (!isSundarGutkaBani) {
setIsSundarGutkaBani(true);
}
if (isCeremonyBani) {
setIsCeremonyBani(false);
}
break;
case 'ceremony':
if (clickedShabad !== ceremonyId) {
setCeremonyId(clickedShabad);
setPreviousIndex(null);
}

if (isSundarGutkaBani) {
setIsSundarGutkaBani(false);
}
if (!isCeremonyBani) {
setIsCeremonyBani(true);
}
} else if (baniType === 'shabad') {
if (clickedShabad !== activeShabadId) {
setActiveShabadId(clickedShabad);
setPreviousIndex(null);
}
if (isSundarGutkaBani) {
setIsSundarGutkaBani(false);
}
if (isCeremonyBani) {
setIsCeremonyBani(false);
}
if (isSundarGutkaBani) {
setIsSundarGutkaBani(false);
}
if (!isCeremonyBani) {
setIsCeremonyBani(true);
}
break;
case 'shabad':
if (clickedShabad !== activeShabadId) {
setActiveShabadId(clickedShabad);
setPreviousIndex(null);
}
if (isSundarGutkaBani) {
setIsSundarGutkaBani(false);
}
if (isCeremonyBani) {
setIsCeremonyBani(false);
}
break;
default:
break;
}
setActiveVerse({ [verseIndex]: newTraversedVerse });
if (activeVerseId !== newTraversedVerse) {
Expand Down
28 changes: 12 additions & 16 deletions www/main/settings/components/SettingViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,17 @@ const SettingViewer = () => {
fontSize: `${gurbaniFontSize * 3}px`,
};

const content1Styles = {
display: content1Visibility ? 'block' : 'none',
fontSize: `${content1FontSize * 3}px`,
fontWeight: 'normal',
};

const content2Styles = {
display: content2Visibility ? 'block' : 'none',
fontSize: `${content2FontSize * 3}px`,
const contentAttributes = {
1: { visibility: content1Visibility, fontSize: content1FontSize },
2: { visibility: content2Visibility, fontSize: content2FontSize },
3: { visibility: content3Visibility, fontSize: content3FontSize },
};

const content3Styles = {
display: content3Visibility ? 'block' : 'none',
fontSize: `${content3FontSize * 3}px`,
};
const getContentStyles = (contentId) => ({
display: contentAttributes[contentId].visibility ? 'block' : 'none',
fontSize: `${contentAttributes[contentId].fontSize * 3}px`,
fontWeight: 'normal',
});

const nextLineStyles = {
fontSize: `${gurbaniFontSize * 3}px`,
Expand Down Expand Up @@ -183,9 +179,9 @@ const SettingViewer = () => {
)}
</div>
</h1>
<h2 style={{ ...content1Styles }}>{multilingual[content1]}</h2>
<h2 style={{ ...content2Styles }}>{multilingual[content2]}</h2>
<h2 style={{ ...content3Styles }}>{multilingual[content3]}</h2>
<h2 style={{ ...getContentStyles(1) }}>{multilingual[content1]}</h2>
<h2 style={{ ...getContentStyles(2) }}>{multilingual[content2]}</h2>
<h2 style={{ ...getContentStyles(3) }}>{multilingual[content3]}</h2>
<h1
className="slide-next-line slide-gurbani gurbani gurmukhi next-line"
style={nextLineStyles}
Expand Down

0 comments on commit 9bcbfb2

Please sign in to comment.