Skip to content

Commit 2aee0f2

Browse files
committed
Fix user profile photo might not replace to proper size
1 parent 1ca39d9 commit 2aee0f2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/models/user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ module.exports = function (sequelize, DataTypes) {
105105
break;
106106
case "gitlab":
107107
photo = profile.avatarUrl;
108-
if (bigger) photo.replace(/(\?s=)\d*$/i, '$1400');
109-
else photo.replace(/(\?s=)\d*$/i, '$196');
108+
if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400');
109+
else photo = photo.replace(/(\?s=)\d*$/i, '$196');
110110
break;
111111
case "dropbox":
112112
//no image api provided, use gravatar
@@ -116,8 +116,8 @@ module.exports = function (sequelize, DataTypes) {
116116
break;
117117
case "google":
118118
photo = profile.photos[0].value;
119-
if (bigger) photo.replace(/(\?sz=)\d*$/i, '$1400');
120-
else photo.replace(/(\?sz=)\d*$/i, '$196');
119+
if (bigger) photo = photo.replace(/(\?sz=)\d*$/i, '$1400');
120+
else photo = photo.replace(/(\?sz=)\d*$/i, '$196');
121121
break;
122122
case "ldap":
123123
//no image api provided,

0 commit comments

Comments
 (0)