Skip to content

Commit

Permalink
test for presence of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
SachaG committed Mar 26, 2015
1 parent f1af288 commit 16bb7b3
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions server/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,19 +500,24 @@ var migrationsList = {
var settings = Settings.findOne();
var set = {};

if (!!settings.buttonColor)
set.accentColor = settings.buttonColor;
if (!!settings) {

if (!!settings.buttonTextColor)
set.accentContrastColor = settings.buttonTextColor;
if (!!settings.buttonColor)
set.accentColor = settings.buttonColor;

if (!!settings.buttonColor)
set.secondaryColor = settings.headerColor;
if (!!settings.buttonTextColor)
set.accentContrastColor = settings.buttonTextColor;

if (!!settings.buttonColor)
set.secondaryColor = settings.headerColor;

if (!!settings.buttonColor)
set.secondaryContrastColor = settings.headerTextColor;

if (!_.isEmpty(set)) {
Settings.update(settings._id, {$set: set}, {validate: false});
}

if (!!settings.buttonColor)
set.secondaryContrastColor = settings.headerTextColor;
if (!_.isEmpty(set)) {
Settings.update(settings._id, {$set: set}, {validate: false});
}
return i;
},
Expand Down

0 comments on commit 16bb7b3

Please sign in to comment.