Skip to content

Commit

Permalink
fix(service): duplicate lyric because the condition is always false
Browse files Browse the repository at this point in the history
  • Loading branch information
Richie-Z committed Mar 25, 2024
1 parent b1def91 commit ec68d5a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/services/translator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ export class TranslatorService {
if (JSON.stringify(translateSetting) !== JSON.stringify(settingService.getGoogleTranslateSetting()) ||
JSON.stringify(kuroshiroSetting) !== JSON.stringify(settingService.getKuroshiroSetting())
) {
isAlreadyTranslated = false
isSettingChanged = true
}

if (checkDomExists({ selector: "div.lyrics-lyrics-container" })) {
if (isAlreadyTranslated) return
if (isAlreadyTranslated && !isSettingChanged) return
translatorService.convertLyric(isSettingChanged && isAlreadyTranslated ? this.originalLyric : undefined).then(() => {
translatorService.renderLyric()
isAlreadyTranslated = true;
Expand Down

0 comments on commit ec68d5a

Please sign in to comment.