Skip to content

Commit

Permalink
fix: do not show download dialog when closing export menu (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Jun 22, 2021
1 parent fa94e46 commit 8d65630
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/renderer/components/MapEditor/ExportButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ const ExportButton = () => {
setMenuAnchor(event.currentTarget)
}

const handleMenuItemClick = format => () => {
const closeMenu = () => {
setMenuAnchor(null)
}

const handleMenuItemClick = format => () => {
closeMenu()
const ext = format === 'shapefile' ? 'zip' : 'geojson'
remote.dialog
.showSaveDialog({
Expand Down Expand Up @@ -157,7 +161,7 @@ const ExportButton = () => {
id='export-menu'
anchorEl={menuAnchor}
open={Boolean(menuAnchor)}
onClose={handleMenuItemClick(null)}
onClose={closeMenu}
>
<MenuItem onClick={handleMenuItemClick('geojson')}>
<FormattedMessage {...m.exportGeoJson} />
Expand Down

0 comments on commit 8d65630

Please sign in to comment.