From 9e8219b4633a6ae3961c7cca27c5ae0e140640e2 Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Thu, 29 Sep 2016 23:51:49 -0400 Subject: [PATCH] fix bugs in profile architecture --- hourglass/client/profile/profile.js | 2 +- hourglass/lib/router.js | 2 +- hourglass/server/main.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hourglass/client/profile/profile.js b/hourglass/client/profile/profile.js index fe9f2b3..e91261f 100644 --- a/hourglass/client/profile/profile.js +++ b/hourglass/client/profile/profile.js @@ -622,7 +622,7 @@ function getProfileData() { // Gets all data related to profile. if(profile.description.includes("Say something about yourself!")) profile.description = ""; profile.school = document.getElementById("school").childNodes[0].nodeValue; - if(profile.school === "Click here to edit...") school = ""; + if(profile.school === "Click here to edit...") profile.school = ""; var gradein = document.getElementById("grade").childNodes[0].nodeValue; profile.grade = parseInt(gradein.substring(gradein.length - 2, gradein)); diff --git a/hourglass/lib/router.js b/hourglass/lib/router.js index cb0c938..737aa8b 100644 --- a/hourglass/lib/router.js +++ b/hourglass/lib/router.js @@ -1,6 +1,6 @@ Router.route('/', { waitOn: function() { - if (!Meteor.userId() || !Meteor.user().profile.school) { + if (!Meteor.userId() || _.contains([null, undefined, ""], Meteor.user().profile.school)) { this.redirect('/login'); } else { return [ diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 73d7882..b1ab797 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -508,7 +508,7 @@ Meteor.methods({ current.banner = "/Banners/defaultcover.jpg"; current.classes = [userId]; current.preferences = { - "theme": "light", + "theme": themeColors.light, "mode": "classes", "timeHide": 1, "done": true,