From 5efd5bf9279ff6fa81c3cc7b040f2da5a87932c9 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 25 Jul 2017 09:20:14 +0100 Subject: [PATCH] done -> then, style --- src/components/views/elements/Pill.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index b7d775fff7..b7731182f9 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -112,7 +112,7 @@ const Pill = React.createClass({ }, doProfileLookup: function(userId, member) { - MatrixClientPeg.get().getProfileInfo(userId).done((resp) => { + MatrixClientPeg.get().getProfileInfo(userId).then((resp) => { member.name = resp.displayname; member.rawDisplayName = resp.displayname; member.events.member = { @@ -120,13 +120,9 @@ const Pill = React.createClass({ return {avatar_url: resp.avatar_url}; }, }; - this.setState({member}); - }, (err) => { - console.error( - 'Could not retrieve profile data for ' + userId + ':', - err, - ); + }).catch((err) => { + console.error('Could not retrieve profile data for ' + userId + ':', err); }); },