Skip to content

Commit

Permalink
Allow GET without displaying the response
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasSp committed Sep 27, 2024
1 parent 2be6b64 commit 95970f9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/infowindow_exporthandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,7 @@ function createExportButtons(
const attributesToSendToExport = obj.attributesToSendToExport || attributesToSendToExportPerLayer;
const exportedFileName = obj.exportedFileName || exportedFileNamePerLayer;
const displayExportResponse = obj.displayExportResponse || displayExportResponsePerLayer || false;
// No point in creating a button that will make unnecessary GET requests
if (requestMethod === 'GET' && !displayExportResponse) {
console.warn('Skipping button for GET request with nothing to display.');
return '';
}

const exportBtn = roundButton
? createCustomExportButton(
roundButtonIcon,
Expand Down Expand Up @@ -371,7 +367,7 @@ function createExportButtons(
default:
break;
}
if (requestMethod === 'GET') {
if (requestMethod === 'GET' && displayExportResponse) {
responseHandler(selectionGroup, data);
}
}
Expand Down

0 comments on commit 95970f9

Please sign in to comment.