Skip to content

Commit

Permalink
fix translation cached (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
an-lee committed Mar 28, 2024
1 parent 58059be commit daa1c3a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions enjoy/src/renderer/components/medias/media-caption-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,12 @@ const SelectedTabContent = (props: {
</div>
<div className="text-sm text-serif text-muted-foreground">
<span
className={`mr-2 font-code ${
i === 0 ? "before:content-['/']" : ""
}
${
i === selectedIndices.length - 1
? "after:content-['/']"
: ""
}`}
className={`mr-2 font-code ${i === 0 ? "before:content-['/']" : ""
}
${i === selectedIndices.length - 1
? "after:content-['/']"
: ""
}`}
>
{word.timeline
.map((t) =>
Expand Down Expand Up @@ -342,7 +340,7 @@ const TranslationTabContent = (props: { text: string }) => {
if (translating) return;

setTranslating(true);
translate(text)
translate(text, `translate-${md5(text)}`)
.then((result) => {
if (result) {
setTranslation(result);
Expand Down Expand Up @@ -450,7 +448,7 @@ const AnalysisTabContent = (props: { text: string }) => {
new URL(props.href ?? "");
props.target = "_blank";
props.rel = "noopener noreferrer";
} catch (e) {}
} catch (e) { }

return <a {...props}>{children}</a>;
},
Expand Down

0 comments on commit daa1c3a

Please sign in to comment.