Skip to content

Commit

Permalink
feat: hoodie.store.connect()
Browse files Browse the repository at this point in the history
  • Loading branch information
ransomw committed Feb 13, 2016
1 parent 5d6c374 commit fdb1546
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ function init (hoodie) {
.reset({ name: hoodie.account.id })
.then(store.connect)
})

if (account.isSignedIn()) {
store.connect()
}
}
6 changes: 4 additions & 2 deletions tests/specs/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test('is "reset" triggered on "signin"', function (t) {
var hoodie = {
account: {
id: 0,
on: simple.stub()
on: simple.stub(),
isSignedIn: simple.stub()
},
store: {
connect: function () {
Expand Down Expand Up @@ -46,7 +47,8 @@ test('is "reset" triggered on "signout"', function (t) {
var hoodie = {
account: {
id: 0,
on: simple.stub()
on: simple.stub(),
isSignedIn: simple.stub()
},
store: {
reset: function (options) {
Expand Down

0 comments on commit fdb1546

Please sign in to comment.