Skip to content

Commit

Permalink
Merge pull request #1961 from Gauravjeetsingh/quicktools-issue
Browse files Browse the repository at this point in the history
Quicktools issue with Annoucements/misc slides
  • Loading branch information
Gauravjeetsingh authored Jun 3, 2024
2 parents 4696541 + ee26da7 commit f0aa3c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions www/main/viewer/Slide/QuickTools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { useStoreActions, useStoreState } from 'easy-peasy';

import { convertToCamelCase } from '../../common/utils';

const remote = require('@electron/remote');

const { i18n } = remote.require('./app');
Expand Down Expand Up @@ -76,7 +78,7 @@ const QuickTools = ({ isMiscSlide }) => {
},
];

const createGlobalPlatformObj = (name, index, action) => {
const createGlobalPlatformObj = (name, toolname, index, action) => {
let payload;
let actionName;
let stateName;
Expand All @@ -85,8 +87,8 @@ const QuickTools = ({ isMiscSlide }) => {
stateName = `content${index}${action}`;
actionName = `setContent${index}${action}`;
} else {
stateName = `gurbani${action}`;
actionName = `setGurbani${action}`;
stateName = `${toolname}${action}`;
actionName = `set${convertToCamelCase(`${toolname}-${action}`, true)}`;
}

if (name === 'visibility') {
Expand Down Expand Up @@ -124,7 +126,7 @@ const QuickTools = ({ isMiscSlide }) => {
onClick={() => {
global.platform.ipc.send(
'update-global-setting',
JSON.stringify(createGlobalPlatformObj(name, index, actionName)),
JSON.stringify(createGlobalPlatformObj(name, toolName, index, actionName)),
);
}}
/>
Expand Down

0 comments on commit f0aa3c5

Please sign in to comment.