Skip to content

Commit

Permalink
chore: reduce false positive logs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwiseman committed Mar 13, 2024
1 parent dd2181b commit 12052c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { cn } from "@/lib/utils";
export function CategoryTable({
categoryData,
assignmentData,
canLog,
}: {
categoryData: AspenCategories;
assignmentData: {
Expand All @@ -28,6 +29,7 @@ export function CategoryTable({
dateAssigned: Date | string | null;
dateDue: Date | string | null;
}[];
canLog?: boolean;
}): React.ReactElement {
const log = useLogger();
const calculatedCategories = calculateCategories([...assignmentData], {
Expand Down Expand Up @@ -165,7 +167,7 @@ export function CategoryTable({
// toast.error("Something went wrong while calculating your average!", {
// duration: 10000,
// });
log.warn("Something went wrong while calculating averages!");
if (canLog) log.warn("Something went wrong while calculating averages!");
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export default function Home({
{categoryData.data || classData.isFetched ? (
<CategoryTable
assignmentData={assignmentAspenData.data || assignmentData.data || []}
// eslint-disable-next-line react/jsx-no-leaked-render -- This is a prop
canLog={assignmentAspenData.isFetched && categoryData.isFetched}
categoryData={
categoryData.isFetched && categoryData.data
? categoryData.data
Expand Down

0 comments on commit 12052c5

Please sign in to comment.