Last active
August 29, 2015 14:02
-
-
Save opsb/d3754a4541a120c92cad to your computer and use it in GitHub Desktop.
Ember currentUser observer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ember.SimpleAuth.Session.reopen({ | |
| updateCurrentUser: function() { | |
| var self = this; | |
| var userId = this.get('user_id'); | |
| if (!Ember.isEmpty(userId)) { | |
| container.lookup('store:main').find('user', userId).then(function(user){ | |
| self.set("currentUser", user); | |
| }); | |
| } | |
| }.observes('user_id') | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment