added user config for dark mode and navigation

This commit is contained in:
Brian McGonagill 2024-07-25 10:25:56 -05:00
parent 1d7ecc3efa
commit 40af926104
7 changed files with 82 additions and 16 deletions

View file

@ -32,11 +32,20 @@ Meteor.methods({
throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
}
return UserConfig.update({ user: this.userId }, {
$set: {
darkMode: pref,
dateUpdate: Date()
}
});
let myConfig = UserConfig.findOne({ user: this.userId });
if (typeof myConfig == 'undefined') {
Meteor.call('add.darkModePref', pref, function(err, result) {
if (err) {
console.log(" ERROR calling the add functioin for dark mode: " + err);
}
});
} else {
return UserConfig.update({ user: this.userId }, {
$set: {
darkMode: pref,
dateUpdate: Date()
}
});
}
}
});