Making it so that Menu and Lists load from db when refreshed.

This commit is contained in:
Brian McGonagill 2024-07-30 11:37:55 -05:00
parent 3ad8fab67b
commit 2f3f82477a
7 changed files with 47 additions and 19 deletions

View file

@ -34,7 +34,13 @@ Template.listItemsForm.helpers({
if (Session.get("listId")) {
selListId = Session.get("listId");
} else {
selListId = UserLast.findOne({ view: "List", userId: Meteor.userId() }).viewId;
selListInfo = UserLast.findOne({ view: "List" });
if (selListInfo) {
selListId = selListInfo.viewId;
Session.set("listId", selListId);
} else {
console.log("not finding any value for viewId.");
}
}
let listInfo = Lists.findOne({ _id: selListId });
if (listInfo) {