Skip to content

Commit

Permalink
Update devDependencies and remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
minpeter committed Feb 14, 2024
1 parent dada94b commit b3e096c
Show file tree
Hide file tree
Showing 3 changed files with 3,287 additions and 11 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"lint": "eslint src/**/*.{ts,tsx} --fix"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand All @@ -43,4 +43,4 @@
"moment": "^2.30.1",
"prettier": "^3.2.4"
}
}
}
16 changes: 8 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ export default function App() {
.catch(() => setServerDown(true));
}, []);

const { toasts } = useToasterStore();
useEffect(() => {
toasts
.filter((t) => t.visible) // Only consider visible toasts
.filter((_, i) => i >= TOAST_LIMIT) // Is toast index over limit
.forEach((t) => toast.dismiss(t.id)); // Dismiss – Use toast.remove(t.id) removal without animation
}, [toasts]);

if (serverDown) {
return (
<S.InfoText>
Expand All @@ -35,14 +43,6 @@ export default function App() {
);
}

const { toasts } = useToasterStore();
useEffect(() => {
toasts
.filter((t) => t.visible) // Only consider visible toasts
.filter((_, i) => i >= TOAST_LIMIT) // Is toast index over limit
.forEach((t) => toast.dismiss(t.id)); // Dismiss – Use toast.remove(t.id) removal without animation
}, [toasts]);

return (
<>
<Routes>
Expand Down
Loading

0 comments on commit b3e096c

Please sign in to comment.