Skip to content

Commit

Permalink
fix: new profile pictures not updated in db (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
daeMOn63 authored Apr 15, 2021
1 parent 00144f2 commit f9002b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions imports/api/blocks/server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,9 @@ Meteor.methods({
try {
if (validator.description && validator.description.identity) {
let profileUrl = getValidatorProfileUrl(validator.description.identity)
if (profileUrl) {
bulkValidators.find({ address: validator.address }).upsert().updateOne({ $set: { 'profile_url': profileUrl } });
if (profileUrl && profileUrl != validator.profile_url) {
console.log("new profile picture for " + validator.address + " : " + profileUrl)
Validators.upsert({ address: validator.address }, { $set: { 'profile_url': profileUrl } })
}
}
} catch (e) {
Expand Down

0 comments on commit f9002b5

Please sign in to comment.