Skip to content

Commit

Permalink
refactor(web): addressing-sonar-check-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Harman-singh-waraich committed Jan 10, 2024
1 parent 2cb97d5 commit 0f752f4
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions web/src/context/NewDisputeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,21 @@ export const NewDisputeProvider: React.FC<{ children: React.ReactNode }> = ({ ch
setDisputeData(initialDisputeData);
};

return (
<NewDisputeContext.Provider
value={{
disputeData,
setDisputeData,
disputeTemplate,
resetDisputeData,
isSubmittingCase,
setIsSubmittingCase,
isPolicyUploading,
setIsPolicyUploading,
}}
>
{children}
</NewDisputeContext.Provider>
const contextValues = useMemo(
() => ({
disputeData,
setDisputeData,
disputeTemplate,
resetDisputeData,
isSubmittingCase,
setIsSubmittingCase,
isPolicyUploading,
setIsPolicyUploading,
}),
[disputeData, disputeTemplate, resetDisputeData, isSubmittingCase, isPolicyUploading]
);

return <NewDisputeContext.Provider value={contextValues}>{children}</NewDisputeContext.Provider>;
};

const constructDisputeTemplate = (disputeData: IDisputeData) => {
Expand Down

0 comments on commit 0f752f4

Please sign in to comment.