Skip to content

Commit

Permalink
Merge pull request #39 from assemblethis/assemblethis-patch-1
Browse files Browse the repository at this point in the history
Remove inconsequential calls to fetchSession() and problematic calls to login
  • Loading branch information
assemblethis authored Dec 4, 2019
2 parents 0b5c57a + 8dd3e0a commit ad2618f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pouch-vue",
"version": "0.3.4",
"version": "0.3.5",
"description": "PouchDB bindings for Vue.js",
"main": "lib/index.js",
"types": "types/index.d.ts",
Expand Down
9 changes: 0 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,6 @@ import { isRemote } from 'pouchdb-utils';
});
});

fetchSession(databases[remoteDB]);

return sync;
},
push(localDB, remoteDB=defaultDB, options = {}) {
Expand Down Expand Up @@ -480,8 +478,6 @@ import { isRemote } from 'pouchdb-utils';
});
});

fetchSession(databases[remoteDB]);

return rep;
},

Expand Down Expand Up @@ -559,8 +555,6 @@ import { isRemote } from 'pouchdb-utils';
});
});

fetchSession(databases[remoteDB]);

return rep;
},

Expand Down Expand Up @@ -605,8 +599,6 @@ import { isRemote } from 'pouchdb-utils';
});
});

fetchSession(databases[db]);

return changes;
},

Expand Down Expand Up @@ -805,7 +797,6 @@ import { isRemote } from 'pouchdb-utils';
} else if (typeof databaseParam === 'string') {
if (!databases[databaseParam]) {
makeInstance(databaseParam);
login(databases[databaseParam]);
}
db = databases[databaseParam];
}
Expand Down
10 changes: 8 additions & 2 deletions tests/testData.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ describe('Set selector to null', () => {
// trip up the watcher on the pouch database config options
let selector = function () { return (this.age < this.maxAge) ? null : {} }

function testFunc() {
function testFunc(done) {
const localVue = createLocalVue()

// add requisite PouchDB plugins
Expand All @@ -232,7 +232,13 @@ describe('Set selector to null', () => {
wrapper.vm.todos = ['north', 'east', 'south', 'west'];

wrapper.vm.maxAge = 50;
expect(wrapper.emitted('pouchdb-livefeed-error')).toHaveLength(1);

//watchers are deferred to the next update cycle that Vue uses to look for changes.
//the change to the selector has a watcher on it in pouch-vue
wrapper.vm.$nextTick(() => {
expect(wrapper.emitted('pouchdb-livefeed-error')).toHaveLength(1);
done();
});
}
test(tryTestName, testFunc);
}
Expand Down

0 comments on commit ad2618f

Please sign in to comment.