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
1 changed files with 4 additions and 4 deletions

View File

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