Pass fetch option to Dropbox

This commit is contained in:
Rob Garrison 2018-11-28 18:31:38 -06:00
parent 2f0dc625c5
commit 534e5a69d0

View File

@ -31,7 +31,10 @@ function hasDropboxAccessToken() {
} }
function requestDropboxAccessToken() { function requestDropboxAccessToken() {
const client = new Dropbox.Dropbox({clientId: DROPBOX_API_KEY}); const client = new Dropbox.Dropbox({
clientId: DROPBOX_API_KEY,
fetch
});
const authUrl = client.getAuthenticationUrl(getRedirectUrlAuthFlow()); const authUrl = client.getAuthenticationUrl(getRedirectUrlAuthFlow());
return launchWebAuthFlow({url: authUrl, interactive: true}) return launchWebAuthFlow({url: authUrl, interactive: true})
.then(urlReturned => { .then(urlReturned => {
@ -57,7 +60,8 @@ $('#sync-dropbox-export').onclick = () => {
.then(token => { .then(token => {
const client = new Dropbox.Dropbox({ const client = new Dropbox.Dropbox({
clientId: DROPBOX_API_KEY, clientId: DROPBOX_API_KEY,
accessToken: token accessToken: token,
fetch
}); });
return client.filesDownload({path: '/' + DROPBOX_FILE}) return client.filesDownload({path: '/' + DROPBOX_FILE})
.then(() => messageBox.confirm(t('overwriteFileExport'))) .then(() => messageBox.confirm(t('overwriteFileExport')))
@ -130,7 +134,8 @@ $('#sync-dropbox-import').onclick = () => {
.then(token => { .then(token => {
const client = new Dropbox.Dropbox({ const client = new Dropbox.Dropbox({
clientId: DROPBOX_API_KEY, clientId: DROPBOX_API_KEY,
accessToken: token accessToken: token,
fetch
}); });
return client.filesDownload({path: '/' + DROPBOX_FILE}) return client.filesDownload({path: '/' + DROPBOX_FILE})
.then(response => { .then(response => {