Updating the materialize library and calls.

This commit is contained in:
Brian McGonagill 2024-07-22 11:56:35 -05:00
parent a118bf38fc
commit e44ef98be4
17 changed files with 10582 additions and 15529 deletions

View file

@ -1,11 +1,27 @@
import { UserConfig } from "../imports/api/userConfig";
Template.MainLayout.onCreated(function() {
this.subscribe("UserConfigPrefs");
});
Template.MainLayout.onRendered(function() {
this.autorun(() => {
let myId = Meteor.userId();
let myprefs = UserConfig.findOne({ user: myId });
if (typeof myprefs != 'undefined') {
if (myprefs.darkPref == "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.");
}
});
});
Template.MainLayout.helpers({