Skip to content

Commit

Permalink
chore(CE): resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumit Dhanania authored and Sumit Dhanania committed Aug 20, 2024
1 parent e20f125 commit 96f7940
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions ui/src/hooks/useErrorToast.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import { useCallback, useEffect } from 'react';
import { useCallback } from 'react';
import useCustomToast from '@/hooks/useCustomToast';
import { CustomToastStatus } from '@/components/Toast';
import { ErrorResponse } from '@/services/common';

export const useErrorToast = (isError: boolean, data: any, isFetched: boolean, message: string) => {
export const useErrorToast = () => {
const showToast = useCustomToast();

<<<<<<< HEAD
useEffect(() => {
if (isError || (!data && isFetched)) {
showToast({
title: `Error: ${message}`,
description: message,
status: CustomToastStatus.Error,
position: 'bottom-right',
});
}
}, [isError, data, isFetched, showToast, message]);
=======
const showErrorToast = useCallback(
(message: string, isError: boolean, data: any, isFetched: boolean) => {
if (isError && !data && isFetched) {
Expand All @@ -33,7 +21,6 @@ export const useErrorToast = (isError: boolean, data: any, isFetched: boolean, m
);

return showErrorToast;
>>>>>>> d901be2e (refactor(CE): changed condition to render toast)
};

export const useAPIErrorsToast = () => {
Expand Down

0 comments on commit 96f7940

Please sign in to comment.