v1.18.x
barisusakli 8 years ago
parent e85e35cf0c
commit 531df7bd09

@ -241,7 +241,14 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
uploadModal.find('.upload-btn').on('click', function () { uploadModal.find('.upload-btn').on('click', function () {
var url = uploadModal.find('#uploadFromUrl').val(); var url = uploadModal.find('#uploadFromUrl').val();
if (!url) { if (!url) {
return; return false;
}
socket.emit('user.uploadProfileImageFromUrl', {
uid: ajaxify.data.uid,
url: url,
}, function (err, url) {
if (err) {
return app.alertError(err);
} }
uploadModal.modal('hide'); uploadModal.modal('hide');
@ -256,7 +263,7 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
paramName: 'uid', paramName: 'uid',
paramValue: ajaxify.data.theirid, paramValue: ajaxify.data.theirid,
}, onUploadComplete); }, onUploadComplete);
});
return false; return false;
}); });
}); });

@ -50,12 +50,7 @@ module.exports = function (User) {
}, next); }, next);
}, },
function (image, next) { function (image, next) {
User.setUserFields(uid, { next(null, image);
uploadedpicture: image.url,
picture: image.url,
}, function (err) {
next(err, image);
});
}, },
], callback); ], callback);
}; };

Loading…
Cancel
Save