Skip to content

Commit

Permalink
Fix issue #1: Error when loaded with fast-render
Browse files Browse the repository at this point in the history
  • Loading branch information
brettle committed Dec 9, 2015
1 parent 323c4b3 commit b2a21d3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 deletions.
36 changes: 18 additions & 18 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
[email protected].1
[email protected].3
[email protected].2
[email protected].4
[email protected]_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
brettle:[email protected].3
brettle:[email protected].0
brettle:[email protected].4
brettle:[email protected].3
[email protected]
check@1.0.6
check@1.1.0
[email protected]
[email protected]
[email protected].1
[email protected].2
[email protected]
[email protected].1
[email protected].2
[email protected]
[email protected]
[email protected].4
ecmascript-collections@0.1.6
[email protected].6
ecmascript-runtime@0.2.6
[email protected]
[email protected].7
[email protected].8
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
local-test:brettle:[email protected].3
local-test:brettle:[email protected].4
[email protected]
[email protected]
[email protected].7
[email protected].9
[email protected].1
[email protected].10
[email protected].10
[email protected].3
[email protected]
[email protected]_2
[email protected]_1
[email protected]
[email protected]
promise@0.4.8
[email protected].4
promise@0.5.1
[email protected].5
[email protected]
[email protected]
[email protected]
Expand All @@ -50,8 +50,8 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected].8
[email protected].9
[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected]
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Change Log
This file documents all notable changes to this project.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [0.0.4] 2015-12-09

### Fixed

Bug #1: Login-state causes error when loaded with Fastrender


9 changes: 8 additions & 1 deletion accounts-login-state-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ LoginState = new LoginStateConstructor();
// the callbacks registered with `LoginState.addSignedUpInterceptor()`.
Meteor.publish(null, function () {
var self = this;
// The function to call to notify the subscriber. We initially set it to
// self.added to workaround meteorhacks:fast-render issue #142
// (https://github.com/kadirahq/fast-render/issues/142). Once self.added() is
// called once, we set it to self.changed().
var updateFunc = self.added.bind(self);

if (!self.userId) {
return null;
}
Expand Down Expand Up @@ -128,8 +134,9 @@ Meteor.publish(null, function () {
// needing to use this.userId instead.
return;
}
self.changed('users', self.userId, {
updateFunc('users', self.userId, {
loginStateSignedUp: LoginState.signedUp(user)
});
updateFunc = self.changed.bind(self);
}
});
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Package.describe({
name: 'brettle:accounts-login-state',
version: '0.0.3',
version: '0.0.4',
// Brief, one-line summary of the package.
summary: "Track the current user's login state and register callbacks that " +
"help calculate it.",
Expand Down

0 comments on commit b2a21d3

Please sign in to comment.