Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into online
Browse files Browse the repository at this point in the history
  • Loading branch information
SIPC committed Mar 10, 2024
2 parents 3ed5179 + 74ce55c commit 72a1ce7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ResultBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function ResultContainer({
isExpanded,
}: ResultContainerProps) {
useEffect(() => {
const version = "1.1";
const version = "1.2";
const localVersion = localStorage.getItem("version");
if (version !== localVersion) {
const keys = Object.keys(localStorage);
Expand Down
11 changes: 10 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,17 @@ export default function Home() {
className={`mt-2`}
variant={`default`}
disabled={loader.translate}
onClick={submit}
data-umami-event={`${from}>${to}`}
onClick={() => {
if (from === to) {
toast({
title: "Translate Error",
description: '源语言和目标语言不能相同',
});
} else {
submit()
}
}}
>
{loader.translate && (
<Loader2 className={`h-4 w-4 mr-1 animate-spin`} />
Expand Down

0 comments on commit 72a1ce7

Please sign in to comment.