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