Commit 5e26bf4c authored by BrittainJackson7's avatar BrittainJackson7
Browse files

Fix bug that transfers queryable selections across collections

parent 8bb730b4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ export default function FootprintResults(props) {
    // Call the callback function to pass the selected title to the Sidebar
    props.updateSelectedTitle(selectedCollectionTitle);

    props.UpdateQueryableTitles(null);


    // Send to Leaflet
    window.postMessage(["setVisibleCollections", newCollectionId], "*");
@@ -203,6 +205,7 @@ export default function FootprintResults(props) {

        }


        // Updates collectionId if switching to a new set of collections (new target)
        let myId = collectionId;
        if (!collections[myId]) {
@@ -219,6 +222,7 @@ export default function FootprintResults(props) {


       

        // Send to Leaflet
        window.postMessage(["setFeatureCollections", myId, collections], "*");
      })();
+6 −0
Original line number Diff line number Diff line
@@ -227,6 +227,10 @@ export default function SearchAndFilterInput(props) {
    UpdateQueryableTitles(selectedOptionsWithValues);
  };

  //queryables
  const handleQueryableRemove = (event) => {
    UpdateQueryableTitles(event);
  };

  // Sorting
  const handleSortChange = (event) => {
@@ -296,6 +300,8 @@ export default function SearchAndFilterInput(props) {
  setAreaTextVal("");    // Area (received by window message from AstroMap)
  setDateFromVal(null); // From Date
  setDateToVal(null);  // To Date
  handleQueryableRemove(null); // properties selection
  

  }, [props.targetName]);

+2 −1
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ export default function Sidebar(props) {
            setQueryAddress={props.setQueryAddress}
            updateSelectedTitle={updateSelectedTitle}
            selectedQueryables = {updatedQueryableTitles}
            UpdateQueryableTitles = {UpdateQueryableTitles}
          />
        </Collapse>
      </div>