Skip to content

Commit

Permalink
Fix toast (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian50 authored Oct 28, 2024
1 parent ff37825 commit 2faab7d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/utils/loggerService.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { throttle } from "lodash";
import { toast } from "react-toastify";

const errorToast = throttle((msg: string) => {
toast.error(
<div>
{msg}
<br />
Check console for more information
</div>,
{ autoClose: 3000 },
);
}, 6000);
class Logger {
error(msg: string, { error, hideToast }: { error: unknown; hideToast?: boolean }) {
if (!hideToast) {
toast.error(
<div>
{msg}
<br />
Check console for more information
</div>,
);
errorToast(msg);
}

console.error("‼️‼️‼️‼️Catched error:", error);
Expand Down

0 comments on commit 2faab7d

Please sign in to comment.