Updating framework to meteor 3 and later

This commit is contained in:
Brian McGonagill 2025-06-21 07:28:59 -05:00
parent 717994508a
commit cca29bc591
58 changed files with 2332 additions and 1611 deletions

View file

@ -7,20 +7,27 @@ Template.MainLayout.onCreated(function() {
Template.MainLayout.onRendered(function() {
this.autorun(() => {
let myId = Meteor.userId();
let myprefs = UserConfig.findOne({ user: myId });
if (typeof myprefs != 'undefined') {
if (myprefs.darkMode == "light") {
console.log("Found theme as light");
Session.set("myTheme", "light");
document.documentElement.setAttribute('theme', "light");
} else {
console.log("Found theme as dark");
Session.set("myTheme", "dark");
document.documentElement.setAttribute('theme', "dark");
}
} else {
console.log("User Prefs appear undefined.");
const getConfig = async() => {
let myprefs = await UserConfig.findOneAsync({ user: myId });
try {
if (!myprefs) {
console.log("User Prefs appear undefined.");
} else {
if (myprefs.darkMode == "light") {
console.log("Found theme as light");
Session.set("myTheme", "light");
document.documentElement.setAttribute('theme', "light");
} else {
console.log("Found theme as dark");
Session.set("myTheme", "dark");
document.documentElement.setAttribute('theme', "dark");
}
}
} catch(error) {
console.log(" ERROR getting user preferences: " + error);
}
}
getConfig();
});
});