Skip to content

Commit

Permalink
Merge pull request #577 from archesproject/575_dependency_updates_lin…
Browse files Browse the repository at this point in the history
…ting

pouchdb now uses fetch, add global lint property, re #575
  • Loading branch information
apeters authored Feb 7, 2020
2 parents 12816f1 + cfb226e commit 4247f94
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ module.exports = {
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
globals: {
Camera: "readonly"
}
}
12 changes: 4 additions & 8 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.archesproject.archescollector"
version="0.2.2"
xmlns="http://www.w3.org/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="org.archesproject.archescollector" version="0.2.2" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>ArchesCollector</name>
<description>
A mobile app to manage Arches resources
Expand Down Expand Up @@ -47,7 +43,7 @@
<edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryAddUsageDescription">
<string>need photo library access to save pictures there</string>
</edit-config>
<engine name="browser" spec="~5.0.3" />
<engine name="android" spec="~7.1.4" />
<engine name="ios" spec="~4.5.5" />
<engine name="browser" spec="^5.0.3" />
<engine name="android" spec="^7.0.0" />
<engine name="ios" spec="4.5.5" />
</widget>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@
"ios"
]
}
}
}
19 changes: 7 additions & 12 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,9 @@ var pouchDBs = (function() {
iosDatabaseLocation: 'Library'
});
this._projectDBs[projectId].remote = new PouchDB(server.url + '/couchdb/project_' + projectId, {
ajax: {
headers: {
authorization: 'Bearer ' + server.token
// 'X-Some-Special-Header': 'foo'
},
withCredentials: false
fetch: function (url, opts) {
opts.headers.set('authorization', 'Bearer ' + server.token);
return PouchDB.fetch(url, opts);
}
});
},
Expand All @@ -74,11 +71,9 @@ var pouchDBs = (function() {
.then(function(doc) {
Object.keys(doc.servers[server.url].projects).forEach(function(projectId) {
self._projectDBs[projectId].remote = new PouchDB(server.url + '/couchdb/project_' + projectId, {
ajax: {
headers: {
authorization: 'Bearer ' + server.token
},
withCredentials: false
fetch: function (url, opts) {
opts.headers.set('authorization', 'Bearer ' + server.token);
return PouchDB.fetch(url, opts);
}
});
});
Expand Down Expand Up @@ -624,10 +619,10 @@ var store = new Vuex.Store({
return store.dispatch('saveServerInfoToPouch');
},
syncRemote: function({ commit, state }, { projectId, syncAttempts }) {
var server = store.getters.activeServer;
store.commit('clearNewlyCreatedResourcesAndTiles', projectId);
return pouchDBs.syncProject(projectId)
.then(function() {
var server = store.getters.activeServer;
return fetch(server.url + '/sync/' + projectId, {
method: 'GET',
headers: new Headers({
Expand Down

0 comments on commit 4247f94

Please sign in to comment.