Skip to content

Commit

Permalink
fix(config): merge machine pronounce config
Browse files Browse the repository at this point in the history
Closes #540
  • Loading branch information
crimx committed Nov 2, 2019
1 parent 3b38d19 commit 1c37346
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/app-config/merge-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ export function mergeConfig(
merge('autopron.cn.dict', id => defaultAllDicts[id])
merge('autopron.en.dict', id => defaultAllDicts[id])
merge('autopron.en.accent', val => val === 'us' || val === 'uk')
merge('autopron.machine.dict', id => defaultAllDicts[id])
merge(
'autopron.machine.src',
val => val === 'trans' || val === 'searchText'
)
break
case 'contextMenus':
forEach(oldConfig.contextMenus.all, (dict, id) => {
Expand Down
5 changes: 2 additions & 3 deletions src/content/redux/modules/epics/searchStart.epic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ export const searchStartEpic: Epic = (action$, state$) =>
if (id === en.dict && (audio.uk || audio.us)) return true
return (
id === machine.dict &&
!!(result as MachineTranslateResult<DictID>)[machine.src]
.audio
!!(result as MachineTranslateResult<DictID>)[machine.src].tts
)
}),
take(1),
Expand All @@ -108,7 +107,7 @@ export const searchStartEpic: Epic = (action$, state$) =>
type: 'PLAY_AUDIO',
payload: (result as MachineTranslateResult<DictID>)[
machine.src
].audio!
].tts!
})
}),
// never pass to down stream
Expand Down

0 comments on commit 1c37346

Please sign in to comment.