File tree Expand file tree Collapse file tree 2 files changed +3
-18
lines changed
main/Desktop/CouncilSelector Expand file tree Collapse file tree 2 files changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ class Map extends React.Component {
437437 } ;
438438
439439 reset = ( ) => {
440- const { dispatchUpdateNcId } = this . props ;
440+ const { dispatchUpdateNcId, dispatchUpdateSelectedCouncils } = this . props ;
441441
442442 this . zoomOut ( ) ;
443443 this . addressLayer . clearMarker ( ) ;
@@ -463,23 +463,18 @@ class Map extends React.Component {
463463 } ) ;
464464
465465 // Reset MinZoom to original value after deselecting NC
466+ this . resetBoundaries ( ) ;
467+ dispatchUpdateSelectedCouncils ( [ ] )
466468 this . map . setMinZoom ( DEFAULT_MIN_ZOOM ) ;
467469 } ;
468470
469471 resetBoundaries = ( ) => {
470472 const {
471473 dispatchUpdateNcId,
472- dispatchUpdateSelectedCouncils,
473- dispatchUpdateUnselectedCouncils,
474- councils,
475474 } = this . props ;
476475
477476 // Reset the selected NcId back to null.
478477 dispatchUpdateNcId ( null ) ;
479-
480- // Reset councilSelector.
481- dispatchUpdateSelectedCouncils ( [ ] ) ;
482- dispatchUpdateUnselectedCouncils ( councils ) ;
483478 } ;
484479
485480 addressSearchIsEmpty = ( ) => {
Original file line number Diff line number Diff line change @@ -44,18 +44,8 @@ function CouncilSelector({
4444 } , [ councils , dispatchUpdateUnselectedCouncils ] ) ;
4545
4646 const handleDelete = e => {
47- const deletedCouncilId = Number ( e . currentTarget . dataset . id ) ;
48- const newSelected = selected . filter (
49- ( { councilId } ) => councilId !== deletedCouncilId ,
50- ) ;
51- const newUnselected = not ( councils , newSelected , 'councilId' ) ;
52- dispatchUpdateSelectedCouncils ( newSelected ) ;
53- dispatchUpdateUnselectedCouncils ( newUnselected ) ;
5447 // Clear out address search input
5548 resetAddressSearch ( ) ;
56-
57- // resetMap() will call dispatchUpdateNcId(null) to reset councilId back to null
58- // in reducers/filters so no need to do it again here
5949 resetMap ( ) ;
6050 //Clear district council search box field on deselect
6151 setSearchTerm ( '' ) ;
You can’t perform that action at this time.
0 commit comments