Fixed profile images not displaying on new user

This commit is contained in:
Kenneth Jao 2016-08-13 20:52:47 -04:00
parent b1381234e2
commit 68c6e0c32b

View File

@ -82,7 +82,7 @@ Template.profile.helpers({
banner() { banner() {
var width = window.innerWidth * 1600 / 1920; var width = window.innerWidth * 1600 / 1920;
var height = width * 615 / 1600; var height = width * 615 / 1600;
if (Meteor.user().profile.banner) { if (Meteor.user().profile.banner !== undefined) {
var banner = Meteor.user().profile.banner; var banner = Meteor.user().profile.banner;
} else { } else {
var banner = "Banners/defaultcover.jpg"; var banner = "Banners/defaultcover.jpg";
@ -94,7 +94,7 @@ Template.profile.helpers({
}, },
avatar() { avatar() {
var dim = window.innerWidth * 1600 / 1920 * 0.16; var dim = window.innerWidth * 1600 / 1920 * 0.16;
if (Meteor.user().profile.avatar) { if (Meteor.user().profile.avatar !== undefined) {
var pic = Meteor.user().profile.avatar + ".png"; var pic = Meteor.user().profile.avatar + ".png";
} else { } else {
var pic = "Avatars/" + (Math.floor(Math.random() * (11 - 1)) + 1).toString(); + ".png"; var pic = "Avatars/" + (Math.floor(Math.random() * (11 - 1)) + 1).toString(); + ".png";