yusuketk 5 лет назад
Родитель
Сommit
e5588b260d
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/server/models/user.js

+ 3 - 3
src/server/models/user.js

@@ -189,7 +189,7 @@ module.exports = function(crowi) {
 
 
   userSchema.methods.updateIsGravatarEnabled = async function(isGravatarEnabled) {
   userSchema.methods.updateIsGravatarEnabled = async function(isGravatarEnabled) {
     this.isGravatarEnabled = isGravatarEnabled;
     this.isGravatarEnabled = isGravatarEnabled;
-    this.imageUrlCached = this.generateImageUrlCached();
+    this.imageUrlCached = await this.generateImageUrlCached();
     const userData = await this.save();
     const userData = await this.save();
     return userData;
     return userData;
   };
   };
@@ -225,7 +225,7 @@ module.exports = function(crowi) {
 
 
   userSchema.methods.updateImage = async function(attachment) {
   userSchema.methods.updateImage = async function(attachment) {
     this.imageAttachment = attachment;
     this.imageAttachment = attachment;
-    this.imageUrlCached = this.generateImageUrlCached();
+    this.imageUrlCached = await this.generateImageUrlCached();
     return this.save();
     return this.save();
   };
   };
 
 
@@ -241,7 +241,7 @@ module.exports = function(crowi) {
     }
     }
 
 
     this.imageAttachment = undefined;
     this.imageAttachment = undefined;
-    this.imageUrlCached = this.generateImageUrlCached();
+    this.imageUrlCached = await this.generateImageUrlCached();
     return this.save();
     return this.save();
   };
   };