Skip to content

Commit

Permalink
0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Węgliński authored and Krzysztof Węgliński committed Jan 17, 2025
1 parent a24b903 commit 67f3f12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### 0.5.1

- Prevent crash on no language selected in language tool.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sth-libretranslate",
"private": true,
"version": "0.5.0",
"version": "0.5.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src/languagecheck/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function App() {
// }, []);

useEffect(() => {
if (q.length > 1) {
if (q.length > 1 && language) {
check(q, language);
}
}, [q, check, language]);
Expand Down
6 changes: 3 additions & 3 deletions src/languagecheck/Resolution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ export const Resolution = ({
};
return (
<div style={{paddingTop: '20px'}}>
{error.length > 0 && (
{error?.length > 0 && (
<Alert icon={<ErrorOutlineIcon fontSize="inherit" />} severity="error">
{error}
</Alert>
)}
{info?.matches.length === 0 && (
{info?.matches?.length === 0 && (
<Alert icon={<CheckIcon fontSize="inherit" />} severity="success">
All good!
</Alert>
)}
{info?.matches.map((data, i) => (
{info?.matches?.map((data, i) => (
<DisplayMatch
key={i}
{...data}
Expand Down

0 comments on commit 67f3f12

Please sign in to comment.