Skip to content

Commit

Permalink
fix: Unnecessary API List count of connectors stop (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja authored Jan 2, 2024
1 parent 7075812 commit 40ae278
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/screens/HyperSwitch/Home/HomeUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ module CheckoutCard = {
let (_authStatus, setAuthStatus) = React.useContext(AuthInfoProvider.authStatusContext)
let {setIsSidebarExpanded} = React.useContext(SidebarProvider.defaultContext)
let isPlayground = HSLocalStorage.getIsPlaygroundFromLocalStorage()
let isConfigureConnector = ListHooks.useListCount(~entityName=CONNECTOR) > 0
let connectorList =
HyperswitchAtom.connectorListAtom
->Recoil.useRecoilValueFromAtom
->LogicUtils.safeParse
->LogicUtils.getObjectArrayFromJson
let isConfigureConnector = connectorList->Array.length > 0
let urlPath = url.path->Belt.List.toArray->Js.Array2.joinWith("_")

let handleOnClick = _ => {
Expand Down
7 changes: 6 additions & 1 deletion src/screens/HyperSwitch/Order/Orders.res
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ let make = (~previewOnly=false) => {
let (searchText, setSearchText) = React.useState(_ => "")
let (filters, setFilters) = React.useState(_ => None)
let (paymentModal, setPaymentModal) = React.useState(_ => false)
let isConfigureConnector = ListHooks.useListCount(~entityName=CONNECTOR) > 0
let connectorList =
HyperswitchAtom.connectorListAtom
->Recoil.useRecoilValueFromAtom
->LogicUtils.safeParse
->LogicUtils.getObjectArrayFromJson
let isConfigureConnector = connectorList->Array.length > 0

let (widthClass, heightClass) = React.useMemo1(() => {
previewOnly ? ("w-full", "max-h-96") : ("w-full", "")
Expand Down

0 comments on commit 40ae278

Please sign in to comment.