Skip to content

Commit

Permalink
fix(FOROME-1306): set active preset before edit (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgeniySobolev authored and AndreyUstyumenko committed Jul 11, 2022
1 parent 9ed3953 commit c781f0d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pages/ws/ui/control-panel/edit-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ import { useParams } from '@core/hooks/use-params'
import { SessionStoreManager } from '@core/storage-management/session-store-manager'
import { t } from '@i18n'
import filterStore from '@store/filter'
import filterPresetsStore from '@store/filter-presets'
import { Routes } from '@router/routes.enum'
import { Button } from '@ui/button'
import { GlbPagesNames } from '@glb/glb-names'
import { FILTER_REFERRER } from '@pages/filter/common/filter-control/filter-control.const'

export const EditFilter = observer((): ReactElement => {
const histroy = useHistory()
const history = useHistory()
const params = useParams()
const { activePreset } = filterPresetsStore

const handleClick = () => {
let location = `${Routes.Refiner}?ds=${params.get('ds')}`

location = activePreset ? `${location}&preset=${activePreset}` : location
SessionStoreManager.write(FILTER_REFERRER, GlbPagesNames.Table)
histroy.push(`${Routes.Refiner}?ds=${params.get('ds')}`)
history.push(location)
filterStore.setMethod(GlbPagesNames.Refiner)
}

Expand Down

0 comments on commit c781f0d

Please sign in to comment.