Fixed profile description not saving when user has avatar.
This commit is contained in:
parent
9c388f04c7
commit
632dc96bc1
|
@ -2,3 +2,4 @@ node_modules/
|
||||||
config/*.js
|
config/*.js
|
||||||
!config/default.js
|
!config/default.js
|
||||||
output/
|
output/
|
||||||
|
dist/
|
||||||
|
|
|
@ -14,10 +14,7 @@ function saveProfileDetails(user) {
|
||||||
|
|
||||||
if(config.library.profile.avoidAvatar && new urlPattern('http(s)\\://(www.)redditstatic.com/avatars/:id(.:ext)(?:query)').match(image)) {
|
if(config.library.profile.avoidAvatar && new urlPattern('http(s)\\://(www.)redditstatic.com/avatars/:id(.:ext)(?:query)').match(image)) {
|
||||||
console.log('\x1b[33m%s\x1b[0m', `Ignoring standard avatar profile image for '${user.name}'`);
|
console.log('\x1b[33m%s\x1b[0m', `Ignoring standard avatar profile image for '${user.name}'`);
|
||||||
|
} else {
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
const filepath = interpolate(config.library.profile.image, user, null, {
|
const filepath = interpolate(config.library.profile.image, user, null, {
|
||||||
// pass profile image as item to interpolate extension variable
|
// pass profile image as item to interpolate extension variable
|
||||||
url: image
|
url: image
|
||||||
|
@ -27,6 +24,7 @@ function saveProfileDetails(user) {
|
||||||
console.log('\x1b[33m%s\x1b[0m', `Could not save profile image for '${user.name}': ${error}`);
|
console.log('\x1b[33m%s\x1b[0m', `Could not save profile image for '${user.name}': ${error}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(config.library.profile.description) {
|
if(config.library.profile.description) {
|
||||||
if(user.profile && user.profile.description) {
|
if(user.profile && user.profile.description) {
|
||||||
|
|
Loading…
Reference in New Issue