Fix user profile photo might not replace to proper size

This commit is contained in:
Wu Cheng-Han 2017-02-18 20:07:15 +08:00
parent 1ca39d9c8e
commit 2aee0f267c

View file

@ -105,8 +105,8 @@ module.exports = function (sequelize, DataTypes) {
break; break;
case "gitlab": case "gitlab":
photo = profile.avatarUrl; photo = profile.avatarUrl;
if (bigger) photo.replace(/(\?s=)\d*$/i, '$1400'); if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400');
else photo.replace(/(\?s=)\d*$/i, '$196'); else photo = photo.replace(/(\?s=)\d*$/i, '$196');
break; break;
case "dropbox": case "dropbox":
//no image api provided, use gravatar //no image api provided, use gravatar
@ -116,8 +116,8 @@ module.exports = function (sequelize, DataTypes) {
break; break;
case "google": case "google":
photo = profile.photos[0].value; photo = profile.photos[0].value;
if (bigger) photo.replace(/(\?sz=)\d*$/i, '$1400'); if (bigger) photo = photo.replace(/(\?sz=)\d*$/i, '$1400');
else photo.replace(/(\?sz=)\d*$/i, '$196'); else photo = photo.replace(/(\?sz=)\d*$/i, '$196');
break; break;
case "ldap": case "ldap":
//no image api provided, //no image api provided,