From aeb2e98e9313e4da2e2d4ab04bac23ef40f9e388 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Poussard?= <tpoussard@neogeo.fr>
Date: Wed, 17 Nov 2021 16:50:11 +0100
Subject: [PATCH] fetch blob instead of window.url to download file

---
 src/views/feature_type/Feature_type_detail.vue | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/views/feature_type/Feature_type_detail.vue b/src/views/feature_type/Feature_type_detail.vue
index ed3fbcca..80e1e6eb 100644
--- a/src/views/feature_type/Feature_type_detail.vue
+++ b/src/views/feature_type/Feature_type_detail.vue
@@ -340,15 +340,15 @@ export default {
 
     exportFeatures() {
       const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature-type/${this.$route.params.feature_type_slug}/export/`;
-      featureAPI
-        .getFeaturesBlob(url)
-        .then((blob) => {
+      featureAPI.getFeaturesBlob(url).then((blob) => {
+        if (blob) {
           const link = document.createElement("a");
           link.href = URL.createObjectURL(blob);
           link.download = `${this.project.title}-${this.structure.title}.json`;
           link.click();
           URL.revokeObjectURL(link.href);
-        })
+        }
+      });
     },
   },
 
-- 
GitLab