Przeglądaj źródła

Download as .endpoint file if one is selected

If just one endpoint is selected in Endpoints list page, download it as
.endpoint and skip zipping it.
Sergiu Miclea 6 lat temu
rodzic
commit
f73f95bd44

+ 5 - 1
src/components/pages/EndpointsPage/EndpointsPage.jsx

@@ -194,7 +194,11 @@ class EndpointsPage extends React.Component<{ history: any }, State> {
   }
 
   handleExportToJson() {
-    endpointStore.exportToZip(this.state.selectedEndpoints)
+    if (this.state.selectedEndpoints.length === 1) {
+      endpointStore.exportToJson(this.state.selectedEndpoints[0])
+    } else {
+      endpointStore.exportToZip(this.state.selectedEndpoints)
+    }
   }
 
   handleDeleteAction() {