Skip to content

Commit af6e1fb

Browse files
committed
fix(mensa): ensure that main mensa is set, if session is newly created
otherwise things only start to work, if you switch to another mensa and back
1 parent 7d2fff2 commit af6e1fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/menu/mensa/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ function getCurrentSettings(ctx: MyContext): Readonly<{mensa?: string; date: Dat
5252
if (!mensa || (now - date) > DAY_IN_MS) {
5353
date = Date.now();
5454
mensa = ctx.userconfig.mine.mensa.main;
55+
ctx.session.mensa ??= {}
56+
ctx.session.mensa.mensa = mensa;
5557
}
5658

5759
return {mensa, date: new Date(date)};

0 commit comments

Comments
 (0)