Skip to content

Commit

Permalink
DataViews: fix status filter upon switching the default views from th…
Browse files Browse the repository at this point in the history
…e sidebar (#55856)
  • Loading branch information
oandregal authored Nov 6, 2023
1 parent bc704e1 commit ef5887d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/edit-site/src/components/dataviews/in-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ import {
const OPERATOR_IN = 'in';

export default ( { filter, view, onChangeView } ) => {
const activeValue = view.filters.find(
const valueFound = view.filters.find(
( f ) => f.field === filter.id && f.operator === OPERATOR_IN
)?.value;
);

const activeValue =
! valueFound || ! valueFound.hasOwnProperty( 'value' )
? ''
: valueFound.value;

return (
<SelectControl
Expand Down

0 comments on commit ef5887d

Please sign in to comment.