Skip to content

Commit

Permalink
fix: tts error
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Jun 23, 2024
1 parent 25d164f commit c57a14d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/window/Config/pages/History/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ export default function History() {
}) && (
<TableRow key={item.id}>
<TableCell>
{item.service.startsWith('plugin') ? (
{getServiceSouceType(item.service) === ServiceSourceType.PLUGIN ? (
<img
src={pluginList['translate'][item.service].icon}
src={pluginList['translate'][getServiceName(item.service)].icon}
className='h-[18px] w-[18px] my-auto mr-[8px]'
draggable={false}
/>
) : (
<img
src={`${builtinServices[item.service].info.icon}`}
src={`${builtinServices[getServiceName(item.service)].info.icon}`}
className='h-[18px] w-[18px] my-auto mr-[8px]'
draggable={false}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/window/Translate/components/SourceArea/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ export default function SourceArea(props) {
}, [hideWindow]);

useEffect(() => {
if (ttsServiceList && ttsServiceList[0].startsWith('plugin')) {
readTextFile(`plugins/tts/${ttsServiceList[0]}/info.json`, {
if (ttsServiceList && getServiceSouceType(ttsServiceList[0]) === ServiceSourceType.PLUGIN) {
readTextFile(`plugins/tts/${getServiceName(ttsServiceList[0])}/info.json`, {
dir: BaseDirectory.AppConfig,
}).then((infoStr) => {
setTtsPluginInfo(JSON.parse(infoStr));
Expand Down
4 changes: 2 additions & 2 deletions src/window/Translate/components/TargetArea/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ export default function TargetArea(props) {

// refresh tts config
useEffect(() => {
if (ttsServiceList && ttsServiceList[0].startsWith('plugin')) {
readTextFile(`plugins/tts/${ttsServiceList[0]}/info.json`, {
if (ttsServiceList && getServiceSouceType(ttsServiceList[0]) === ServiceSourceType.PLUGIN) {
readTextFile(`plugins/tts/${getServiceName(ttsServiceList[0])}/info.json`, {
dir: BaseDirectory.AppConfig,
}).then((infoStr) => {
setTtsPluginInfo(JSON.parse(infoStr));
Expand Down

0 comments on commit c57a14d

Please sign in to comment.