mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 05:29:17 -06:00
FIX: Clicking avatars broke for non-admins
This commit is contained in:
parent
461196f089
commit
67c4c90159
@ -74,7 +74,14 @@ export default ObjectController.extend({
|
|||||||
self.set('cardTarget', target);
|
self.set('cardTarget', target);
|
||||||
|
|
||||||
Discourse.User.findByUsername(username).then(function (user) {
|
Discourse.User.findByUsername(username).then(function (user) {
|
||||||
self.setProperties({ user: Discourse.AdminUser.create(user), avatar: user, visible: true});
|
|
||||||
|
// A bit hacky. If viewing admin, wrap it in Discourse.AdminUser
|
||||||
|
// TODO: Restructure this to be cleaner
|
||||||
|
var wrapped = user;
|
||||||
|
if (self.get('viewingAdmin')) {
|
||||||
|
wrapped = Discourse.AdminUser.create(user);
|
||||||
|
}
|
||||||
|
self.setProperties({ user: wrapped, avatar: user, visible: true});
|
||||||
self.appEvents.trigger('usercard:shown');
|
self.appEvents.trigger('usercard:shown');
|
||||||
}).finally(function(){
|
}).finally(function(){
|
||||||
self.set('userLoading', null);
|
self.set('userLoading', null);
|
||||||
|
Loading…
Reference in New Issue
Block a user