@@ -13,9 +13,9 @@ import {
1313import { observer , disposeOnUnmount , inject } from 'mobx-react' ;
1414import * as portals from 'react-reverse-portal' ;
1515
16- import { WithInjected , CollectedEvent , HttpExchangeView , RawTunnel } from '../../types' ;
16+ import { WithInjected , CollectedEvent , HttpExchangeView } from '../../types' ;
1717import { NARROW_LAYOUT_BREAKPOINT , styled } from '../../styles' ;
18- import { useHotkeys , isEditable , windowSize , AriaCtrlCmd , Ctrl } from '../../util/ui' ;
18+ import { useHotkeys , isEditable , windowSize , AriaCtrlCmd } from '../../util/ui' ;
1919import { debounceComputed } from '../../util/observable' ;
2020import { UnreachableCheck , unreachableCheck } from '../../util/error' ;
2121
@@ -28,7 +28,7 @@ import { RulesStore } from '../../model/rules/rules-store';
2828import { AccountStore } from '../../model/account/account-store' ;
2929import { SendStore } from '../../model/send/send-store' ;
3030import { HttpExchange } from '../../model/http/http-exchange' ;
31- import { FilterSet } from '../../model/filters/search-filters' ;
31+ import { Filter , FilterSet } from '../../model/filters/search-filters' ;
3232import { buildRuleFromExchange } from '../../model/rules/rule-creation' ;
3333
3434import { SplitPane } from '../split-pane' ;
@@ -254,7 +254,8 @@ class ViewPage extends React.Component<ViewPageProps> {
254254 this . onPin ,
255255 this . onDelete ,
256256 this . onBuildRuleFromExchange ,
257- this . onPrepareToResendRequest
257+ this . onPrepareToResendRequest ,
258+ this . onAddSearchFilter
258259 ) ;
259260
260261 componentDidMount ( ) {
@@ -500,6 +501,23 @@ class ViewPage extends React.Component<ViewPageProps> {
500501 this . searchFiltersUnderConsideration = filters ;
501502 }
502503
504+ @action . bound
505+ onAddSearchFilter ( filter : Filter ) {
506+ if ( this . searchFiltersUnderConsideration ) {
507+ this . searchFiltersUnderConsideration = [
508+ this . searchFiltersUnderConsideration [ 0 ] ,
509+ filter ,
510+ ...this . searchFiltersUnderConsideration . slice ( 1 )
511+ ] ;
512+ }
513+
514+ this . props . uiStore . activeFilterSet = [
515+ this . props . uiStore . activeFilterSet [ 0 ] ,
516+ filter ,
517+ ...this . props . uiStore . activeFilterSet . slice ( 1 )
518+ ]
519+ }
520+
503521 @action . bound
504522 onSelected ( event : CollectedEvent | undefined ) {
505523 this . props . uiStore . setSelectedEventId ( event ?. id ) ;
0 commit comments