Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
[Bug] Fixed dropbox upload in Firefox. Passing explicit file name to upload function
Giuseppe Macrì33c785f90ad1
diff --git a/examples/demo-app/src/actions.js b/examples/demo-app/src/actions.jsindex c31de993f..7922af03d 100644--- a/examples/demo-app/src/actions.js+++ b/examples/demo-app/src/actions.js@@ -359,10 +359,11 @@ export function exportFileToCloud(handlerName = 'dropbox') {// extract data from keplerconst data = KeplerGlSchema.save(getState().demo.keplerGl.map);const newBlob = new Blob([JSON.stringify(data)], {type: 'application/json'});- const file = new File([newBlob], `/keplergl_${generateHashId(6)}.json`);+ const fileName = `/keplergl_${generateHashId(6)}.json`;+ const file = new File([newBlob], fileName);// We are gonna pass the correct auth token to init the cloud providerdispatch(setPushingFile(true, {filename: file.name, status: 'uploading', metadata: null}));- authHandler.uploadFile({blob: file, isPublic: true, authHandler})+ authHandler.uploadFile({blob: file, name: fileName, isPublic: true, authHandler})// need to perform share as well.then(response => {diff --git a/examples/demo-app/src/utils/cloud-providers/dropbox.js b/examples/demo-app/src/utils/cloud-providers/dropbox.jsindex 4ffbdb346..a45b5f33e 100644--- a/examples/demo-app/src/utils/cloud-providers/dropbox.js+++ b/examples/demo-app/src/utils/cloud-providers/dropbox.js@@ -77,7 +77,7 @@ function getAccessTokenFromLocation(location) {*/function uploadFile({blob, name, isPublic = true}) {const promise = dropbox.filesUpload({- path: blob.name || name,+ path: name || blob.name,contents: blob});diff --git a/examples/demo-app/webpack.config.js b/examples/demo-app/webpack.config.jsindex a63dbea96..e898e2f25 100644--- a/examples/demo-app/webpack.config.js+++ b/examples/demo-app/webpack.config.js@@ -73,7 +73,8 @@ const CONFIG = {// Optional: Enables reading mapbox and dropbox client token from environment variableplugins: [new webpack.EnvironmentPlugin([- 'MapboxAccessToken'+ 'MapboxAccessToken',+ 'DropboxClientId'])]};