refactor: async/await file

This commit is contained in:
Barış Soner Uşaklı
2019-09-23 22:30:17 -04:00
parent 223c108cc6
commit f9d6912b4a
7 changed files with 93 additions and 176 deletions

View File

@@ -1,10 +1,10 @@
'use strict';
var nconf = require('nconf');
var meta = require('./meta');
const nconf = require('nconf');
const meta = require('./meta');
var coverPhoto = module.exports;
const coverPhoto = module.exports;
coverPhoto.getDefaultGroupCover = function (groupName) {
return getCover('groups', groupName);
@@ -17,7 +17,7 @@ coverPhoto.getDefaultProfileCover = function (uid) {
function getCover(type, id) {
const defaultCover = nconf.get('relative_path') + '/assets/images/cover-default.png';
if (meta.config[type + ':defaultCovers']) {
var covers = String(meta.config[type + ':defaultCovers']).trim().split(/[\s,]+/g);
const covers = String(meta.config[type + ':defaultCovers']).trim().split(/[\s,]+/g);
let coverPhoto = defaultCover;
if (!covers.length) {
return coverPhoto;