mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
userDetails should handle errors properly
This commit is contained in:
@@ -208,6 +208,7 @@ iD.Connection = function(context) {
|
||||
|
||||
function userDetails(callback) {
|
||||
function done(err, user_details) {
|
||||
if (err) return callback(err);
|
||||
var u = user_details.getElementsByTagName('user')[0],
|
||||
img = u.getElementsByTagName('img'),
|
||||
image_url = '';
|
||||
|
||||
@@ -5,10 +5,12 @@ iD.ui.userpanel = function(connection) {
|
||||
function update() {
|
||||
if (connection.authenticated()) {
|
||||
selection.style('display', 'block');
|
||||
connection.userDetails(function(user_details) {
|
||||
connection.userDetails(function(err, user_details) {
|
||||
|
||||
selection.html('');
|
||||
|
||||
if (err) return;
|
||||
|
||||
// Link
|
||||
var userLink = selection.append('a')
|
||||
.attr('href', connection.url() + '/user/' +
|
||||
|
||||
Reference in New Issue
Block a user