Skip to content

Commit

Permalink
init filter change
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarnaikjuspay committed Dec 7, 2023
1 parent 7379a37 commit 13aefa2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/screens/HyperSwitch/Analytics/Analytics.res
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ let make = (

let updateComponentPrefrences = useUpdateFilterObject(~index)
let setInitialFilters = HSwitchRemoteFilter.useSetInitialFilters(
~index,
~updateComponentPrefrences,
~updateExistingKeys,
~startTimeFilterKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ module SystemMetricsAnalytics = {
let startTimeVal = getModuleFilters->getString(startTimeFilterKey, "")
let endTimeVal = getModuleFilters->getString(endTimeFilterKey, "")
let updateComponentPrefrences = UrlUtils.useUpdateUrlWith(~prefix="")
let {index, filterValue, updateExistingKeys} = FilterContext.filterContext->React.useContext
let {filterValue, updateExistingKeys} = FilterContext.filterContext->React.useContext
let (_totalVolume, setTotalVolume) = React.useState(_ => 0)
let defaultFilters = [startTimeFilterKey, endTimeFilterKey]

Expand All @@ -358,7 +358,6 @@ module SystemMetricsAnalytics = {
}

let setInitialFilters = HSwitchRemoteFilter.useSetInitialFilters(
~index,
~updateComponentPrefrences,
~updateExistingKeys,
~startTimeFilterKey,
Expand Down
4 changes: 1 addition & 3 deletions src/screens/HyperSwitch/HSwitchRemoteFilter.res
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,13 @@ let getFilterFields: Js.Json.t => array<EntityType.optionType<'t>> = json => {
}

let useSetInitialFilters = (
~index,
~updateComponentPrefrences,
~updateExistingKeys,
~startTimeFilterKey,
~endTimeFilterKey,
) => {
let {index, filterValueJson} = FilterContext.filterContext->React.useContext
let filterValue = FilterUtils.useFiltersValue(~index)
let {filterValueJson} = FilterContext.filterContext->React.useContext

() => {
let inititalSearchParam = filterValue->FilterUtils.parseUrl
Expand Down Expand Up @@ -222,7 +221,6 @@ module RemoteTableFilters = {
let {index, filterValue, updateExistingKeys, filterValueJson, removeKeys} =
FilterContext.filterContext->React.useContext
let setInitialFilters = useSetInitialFilters(
~index,
~updateComponentPrefrences,
~updateExistingKeys,
~startTimeFilterKey,
Expand Down

0 comments on commit 13aefa2

Please sign in to comment.