Skip to content

Commit

Permalink
Merge pull request #1970 from KhalisFoundation/dev
Browse files Browse the repository at this point in the history
Beta Release 9.2.2
  • Loading branch information
Gauravjeetsingh committed Jun 17, 2024
2 parents 032719a + 0ebab2a commit a54407e
Show file tree
Hide file tree
Showing 30 changed files with 355 additions and 186 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
}
}
}
}
2 changes: 1 addition & 1 deletion packaging/update-packagejson.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const teamId = process.env.APPLE_TEAM_ID;

if (!teamId) {
console.error('TEAM_ID is not defined in the environment variables');
process.exit(1);
process.exit(0);
}

if (!process.env.I_AM_TRAVIS) {
Expand Down
4 changes: 3 additions & 1 deletion www/configs/navigator-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,7 @@
"homeVerse": false,
"content":"",
"baniType": ""
}
},

"disabledContent": []
}
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
8 changes: 4 additions & 4 deletions www/main/addons/ceremonies/components/CeremonyPane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => {
setPaneSelectorActive(true);
};

const onThemeClick = (theme, multipaneId = null) => {
const onThemeClick = (event, theme, multipaneId = null) => {
let parsedTheme = theme;
if (typeof theme === 'string') {
parsedTheme = JSON.parse(theme);
Expand Down 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 Expand Up @@ -183,7 +183,7 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => {
if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) {
openPaneMenu(e, themes.light);
} else {
onThemeClick(themes.light);
onThemeClick(e, themes.light);
}
}}
className="theme-instance"
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
4 changes: 2 additions & 2 deletions www/main/common/sttm-ui/tile/Tile.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import { joinClasses } from '../../utils';
import { classNames, joinClasses } from '../../utils';

const Tile = ({
children,
Expand Down Expand Up @@ -32,7 +32,7 @@ const Tile = ({
className={`ui-tile ${tileClassname}`}
style={theme ? getThemeSwatchStyles(theme) : null}
>
<span className={isEngTransliterated && 'eng-tile'}>{children || content}</span>
<span className={classNames(isEngTransliterated && 'eng-tile')}>{children || content}</span>
</button>
);
};
Expand Down
6 changes: 3 additions & 3 deletions www/main/navigator/Navigator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const remote = require('@electron/remote');
const { i18n } = remote.require('./app');

const Navigator = () => {
const { minimizedBySingleDisplay, currentWorkspace } = useStoreState(
(state) => state.userSettings,
);
const { currentWorkspace } = useStoreState((state) => state.userSettings);

const { minimizedBySingleDisplay } = useStoreState((state) => state.navigator);

const {
displayWaheguruSlide,
Expand Down
3 changes: 3 additions & 0 deletions www/main/navigator/misc/components/favoritePane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,23 @@ export const FavoritePane = ({ className, paneId }) => {
...pane1,
content: i18n.t('MULTI_PANE.SHABAD'),
activeShabad: shabadId,
baniType: 'shabad',
});
break;
case 2:
setPane2({
...pane2,
content: i18n.t('MULTI_PANE.SHABAD'),
activeShabad: shabadId,
baniType: 'shabad',
});
break;
case 3:
setPane3({
...pane3,
content: i18n.t('MULTI_PANE.SHABAD'),
activeShabad: shabadId,
baniType: 'shabad',
});
break;
default:
Expand Down
39 changes: 26 additions & 13 deletions www/main/navigator/search/hooks/use-new-shabad.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useNewShabad = () => {
pane3,
} = useStoreState((state) => state.navigator);

const { currentWorkspace } = useStoreState((state) => state.userSettings);
const { currentWorkspace, defaultPaneId } = useStoreState((state) => state.userSettings);

const {
setActiveShabadId,
Expand All @@ -38,8 +38,21 @@ export const useNewShabad = () => {
} = useStoreActions((actions) => actions.navigator);

return (newSelectedShabad, newSelectedVerse, newSearchVerse, multiPaneId = false) => {
let shabadPane;
if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) {
switch (multiPaneId) {
if (!multiPaneId) {
const existingPane = [pane1, pane2, pane3].filter(
(pane) => pane.activeShabad === newSelectedShabad,
);
if (existingPane.length > 0) {
[shabadPane] = existingPane;
} else {
shabadPane = defaultPaneId;
}
} else {
shabadPane = multiPaneId;
}
switch (shabadPane) {
case 1:
setPane1({
...pane1,
Expand Down Expand Up @@ -95,6 +108,17 @@ export const useNewShabad = () => {
if (activeShabadId !== newSelectedShabad) {
if (currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE')) {
setActiveShabadId(newSelectedShabad);
if (window.socket !== undefined && window.socket !== null) {
window.socket.emit('data', {
type: 'shabad',
host: 'sttm-desktop',
id: newSelectedShabad,
shabadid: newSelectedShabad, // @deprecated
highlight: newSelectedVerse,
homeId: newSelectedVerse,
verseChange: false,
});
}
}

// initialVerseId is the verse which is stored in history
Expand All @@ -111,16 +135,5 @@ export const useNewShabad = () => {
if (newSelectedVerse && activeVerseId !== newSelectedVerse) {
setActiveVerseId(newSelectedVerse);
}
if (window.socket !== undefined && window.socket !== null) {
window.socket.emit('data', {
type: 'shabad',
host: 'sttm-desktop',
id: newSelectedShabad,
shabadid: newSelectedShabad, // @deprecated
highlight: newSelectedVerse,
homeId: newSelectedVerse,
verseChange: false,
});
}
};
};
51 changes: 34 additions & 17 deletions www/main/navigator/shabad/FavShabadIcon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ const { i18n } = remote.require('./app');
const FavShabadIcon = ({ paneId }) => {
const [isLoading, setLoading] = useState(false);
const favBtnRef = useRef(null);
const { activeShabadId, activeVerseId, favShabad, pane1, pane2, pane3 } = useStoreState(
(state) => state.navigator,
);
const {
activeShabadId,
activeVerseId,
favShabad,
pane1,
pane2,
pane3,
isSundarGutkaBani,
isCeremonyBani,
} = useStoreState((state) => state.navigator);
const { currentWorkspace } = useStoreState((state) => state.userSettings);

const { setFavShabad } = useStoreActions((state) => state.navigator);

Expand All @@ -23,21 +31,25 @@ const FavShabadIcon = ({ paneId }) => {
const [currentShabad, setCurrentShabad] = useState(activeShabadId);
const [currentVerse, setCurrentVerse] = useState(activeVerseId);
const [favShabadIndex, setFavShabadIndex] = useState(-1);
const [baniType, setBaniType] = useState('');

useEffect(() => {
if (paneId) {
switch (paneId) {
case 1:
setCurrentShabad(pane1.activeShabad);
setCurrentVerse(pane1.versesRead[0]);
setCurrentVerse(pane1.activeVerse);
setBaniType(pane1.baniType);
break;
case 2:
setCurrentShabad(pane2.activeShabad);
setCurrentVerse(pane2.versesRead[0]);
setCurrentVerse(pane2.activeVerse);
setBaniType(pane2.baniType);
break;
case 3:
setCurrentShabad(pane3.activeShabad);
setCurrentVerse(pane3.versesRead[0]);
setCurrentVerse(pane3.activeVerse);
setBaniType(pane3.baniType);
break;
default:
break;
Expand Down Expand Up @@ -69,17 +81,22 @@ const FavShabadIcon = ({ paneId }) => {
});
};

if (currentShabad && !isLoading && userToken) {
return (
<button
className={classNames('fav-btn', favShabadIndex >= 0 && 'unfav-btn')}
ref={favBtnRef}
title={i18n.t('SHABAD_PANE.FAV_BTN_TOOLTIP')}
onClick={toggleFavShabad}
>
<i className={favShabadIndex < 0 ? 'fa-regular fa-star' : 'fa-solid fa-star'}></i>
</button>
);
if (
baniType === 'shabad' ||
(currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE') && !isSundarGutkaBani && !isCeremonyBani)
) {
if (currentShabad && !isLoading && userToken) {
return (
<button
className={classNames('fav-btn', favShabadIndex >= 0 && 'unfav-btn')}
ref={favBtnRef}
title={i18n.t('SHABAD_PANE.FAV_BTN_TOOLTIP')}
onClick={toggleFavShabad}
>
<i className={favShabadIndex < 0 ? 'fa-regular fa-star' : 'fa-solid fa-star'}></i>
</button>
);
}
}
return null;
};
Expand Down
12 changes: 7 additions & 5 deletions www/main/navigator/shabad/ShabadContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ const ShabadContent = () => {
setTimeout(() => {
const currentIndex = activeShabad.findIndex((obj) => obj.ID === activeVerseId);
// Ignoring flower verse to avoid unwanted scroll during asa di vaar
if (activeVerseId !== 61 && activeShabad[currentIndex].Gurmukhi !== ',') {
if (
currentIndex >= 0 &&
activeVerseId !== 61 &&
activeShabad[currentIndex].Gurmukhi !== ','
) {
virtuosoRef.current.scrollToIndex({
index: currentIndex,
behavior: 'smooth',
Expand Down Expand Up @@ -422,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
Loading

0 comments on commit a54407e

Please sign in to comment.