Skip to content

Commit

Permalink
feat: open advanced filter on load if url params have changed filter …
Browse files Browse the repository at this point in the history
…params

Closes #89
  • Loading branch information
stdavis committed Sep 5, 2022
1 parent 5abbafe commit 62f98b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Filter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useRef } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { Alert, Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';
import { format } from 'sql-formatter';
import { initialState } from '../hooks/useFilterReducer';
import config from '../services/config';
import AdvancedControls from './AdvancedControls';
import './Filter.scss';
Expand All @@ -19,7 +20,7 @@ ErrorFallback.propTypes = {
};

export default function Filter({ mapView, state, dispatch }) {
const [isAdvancedOpen, setIsAdvancedOpen] = React.useState(false);
const [isAdvancedOpen, setIsAdvancedOpen] = React.useState(JSON.stringify(state) !== JSON.stringify(initialState));
const headerRef = useRef();
const toggleAdvanced = () => {
if (isAdvancedOpen) {
Expand Down

0 comments on commit 62f98b1

Please sign in to comment.