Please sign in to comment.
Change interface for determining if the user doc is loaded to a new r…
…eactive function Meteor.userLoaded(), which is true if you are logged in and the user doc is loaded, and a currentUserLoaded Handlebars helper to match. If logged in and the user doc is not yet loaded, Meteor.user() now returns an object which only contains _id. The current user subscription is now named meteor.currentUser rather than being an unnamed sub. (loginServiceConfiguration is renamed meteor.loginServiceConfiguration to match.) This subscription is sub'd from when you log in and unsub'd from when you log out (or if you log in with different credentials). I was very careful to make sure that in the case of "sub #1, unsub #1, sub #2, sub #1 is ready" we do not declare the user to be ready. I could have instead modified livedata_connection to not call ready callbacks for unsub'd subscriptions (add a "delete self.sub_ready_callbacks[obj._id]" to the self.subs removed function) but this seemed less invasive. The password and email tests use this to take a more rigorous approach to waiting for the data to load, and they change the localStorage keys so that multiple tabs running tests don't interact via localStorage.
- Loading branch information...
Showing with 192 additions and 122 deletions.
- +59 −15 packages/accounts-base/accounts_client.js
- +13 −4 packages/accounts-base/accounts_server.js
- +8 −21 packages/accounts-base/localstorage_token.js
- +56 −28 packages/accounts-password/email_tests.js
- +50 −48 packages/accounts-password/passwords_tests.js
- +3 −3 packages/accounts-ui-unstyled/login_buttons.html
- +3 −3 packages/accounts-ui-unstyled/login_buttons_dropdown.html
Oops, something went wrong.