Skip to content

Commit

Permalink
fix: check for null or undefined, instead of just undefined
Browse files Browse the repository at this point in the history
Fixes #2229

chore: remove success message on run now

chore: remove console logs for errors

chore: remove error loggin in check run now
  • Loading branch information
mainawycliffe authored and moshloop committed Sep 3, 2024
1 parent b49e92b commit ba21f91
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions src/api/query-hooks/health.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ export function useGetCheckDetails(checkId?: string) {
return useQuery({
queryKey: ["check", "details", checkId],
queryFn: async () => {
console.log("checkId", checkId);
const res = await getHealthCheckDetails(checkId!);
return res;
},
enabled: checkId !== undefined
enabled: !!checkId
});
}
5 changes: 0 additions & 5 deletions src/components/Canary/CanaryPopup/CheckRunNow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Button } from "@flanksource-ui/ui/Buttons/Button";
import { useMutation } from "@tanstack/react-query";
import { FaSpinner } from "react-icons/fa";
import { VscDebugRerun } from "react-icons/vsc";
import { toastSuccess } from "../../Toast/toast";

// admin, editor, responder, commander roles are allowed to run checks
const allowedRoles = ["admin", "editor", "responder", "commander"];
Expand All @@ -27,11 +26,7 @@ export default function CheckRunNow({
const { isLoading, mutate: runNow } = useMutation({
mutationFn: runHealthCheckNow,
onSuccess: (data) => {
toastSuccess("You have successfully initiated the check run.");
onSuccessfulRun(data.data);
},
onError: (error) => {
console.error("Error running check", error);
}
});

Expand Down
2 changes: 0 additions & 2 deletions src/ui/Icons/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,6 @@ export function Icon({
return "text-gray-700";
}, [iconWithColor]);

console.log("IconSVG", IconSVG, colorClassName);

if (name && (name.startsWith("http:") || name.startsWith("https://"))) {
// eslint-disable-next-line @next/next/no-img-element
return <img src={name} className={className} alt={alt} {...props} />;
Expand Down

0 comments on commit ba21f91

Please sign in to comment.