Skip to content

Commit

Permalink
fix: disable bani controller in multipane workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravjeetsingh committed Jun 11, 2024
1 parent ef98e6d commit 6749dd7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
7 changes: 7 additions & 0 deletions www/main/addons/bani-controller/components/BaniController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const BaniController = ({ onScreenClose, className }) => {
content2FontSize,
content3FontSize,
baniLength,
currentWorkspace,
// mangalPosition,
} = useStoreState((state) => state.userSettings);

Expand Down Expand Up @@ -230,6 +231,12 @@ const BaniController = ({ onScreenClose, className }) => {
<div className="sttm-loader" />
) : (
<>
{currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE') && (
<p className="error-msg">
<i className="fa-solid fa-triangle-exclamation"></i>
<span>Bani controller is not supported in Multi-Pane workspace.</span>
</p>
)}
<div className="sync-code-label">
{codeLabel || i18n.t('TOOLBAR.SYNC_CONTROLLER.UNIQUE_CODE_LABEL')}
</div>
Expand Down
6 changes: 5 additions & 1 deletion www/main/navigator/search/hooks/use-new-shabad.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ export const useNewShabad = () => {
if (newSelectedVerse && activeVerseId !== newSelectedVerse) {
setActiveVerseId(newSelectedVerse);
}
if (window.socket !== undefined && window.socket !== null) {
if (
window.socket !== undefined &&
window.socket !== null &&
currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE')
) {
window.socket.emit('data', {
type: 'shabad',
host: 'sttm-desktop',
Expand Down
11 changes: 1 addition & 10 deletions www/main/navigator/shabad/ShabadText.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ShabadVerse } from '../../common/sttm-ui';
import {
changeHomeVerse,
changeVerse,
sendToBaniController,
filterRequiredVerseItems,
udpateHistory,
scrollToVerse,
Expand Down Expand Up @@ -73,7 +72,7 @@ export const ShabadText = ({
const virtuosoRef = useRef(null);
const activeVerseRef = useRef(null);

const updateTraversedVerse = (newTraversedVerse, verseIndex, crossPlatformID = null) => {
const updateTraversedVerse = (newTraversedVerse, verseIndex) => {
if (isMiscSlide) {
setIsMiscSlide(false);
}
Expand Down Expand Up @@ -103,14 +102,6 @@ export const ShabadText = ({
setPaneAttributes,
paneAttributes,
});
sendToBaniController(crossPlatformID, filteredItems, newTraversedVerse, baniLength, {
isSundarGutkaBani,
sundarGutkaBaniId,
isCeremonyBani,
ceremonyId,
activeShabadId,
paneAttributes,
});
};

const updateHomeVerse = (verseIndex) => {
Expand Down
15 changes: 13 additions & 2 deletions www/src/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,22 @@ button {
bottom: 0;
height: 100vh;
left: 60px;
max-height: 750px;
max-height: 780px;
max-width: 850px;
overflow: auto;
position: fixed;
width: calc(100% - 100px);

.error-msg{
i {
padding-right: 6px;
}
background: $rust-red;
border-radius: 6px;
color: white;
margin-top: 0;
padding: 6px;
}
}

.sundar-gutka-wrapper,
Expand Down Expand Up @@ -606,7 +617,7 @@ button {

&.instructions-btn {
align-items: center;
background-color: #973737;
background-color: $rust-red;
color: white;
display: flex;
margin: auto;
Expand Down
1 change: 1 addition & 0 deletions www/src/scss/themes/helpers/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $bright-red: #ff0000;
$cadmium-orange: #e1802f;
$princeton-orange: #ff802e;
$rust: #b24601;
$rust-red: #973737;

$light-green: #27ae60;
$apple-green: #65a757;
Expand Down

0 comments on commit 6749dd7

Please sign in to comment.