aboutsummaryrefslogtreecommitdiff
path: root/src/student-prod.ts
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2026-09-17 17:07:02 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2026-09-17 17:07:02 +0200
commitbc9cdc0bff49ebf553be19dd959a25d6e97ec23a (patch)
treed27e27da54d51c76f2464ddb8a2ea3009aa1ba0a /src/student-prod.ts
parenta5d07617216641e35f5358d7231852ab31fb436c (diff)
downloadbycs-sol-bc9cdc0bff49ebf553be19dd959a25d6e97ec23a.tar.gz
bycs-sol-bc9cdc0bff49ebf553be19dd959a25d6e97ec23a.zip
use course dependent local cache key
This prevents multiple courses overwriting the cached values.
Diffstat (limited to 'src/student-prod.ts')
-rw-r--r--src/student-prod.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/student-prod.ts b/src/student-prod.ts
index 90398c9..68b65eb 100644
--- a/src/student-prod.ts
+++ b/src/student-prod.ts
@@ -1,6 +1,6 @@
import type { Graduation } from "./graduation-common.ts";
import { Student } from "./student-common.ts";
-import { getUserIconUrl, getCourseParticipantsUrl } from "./utils-prod.js";
+import { getCourseId, getUserIconUrl, getCourseParticipantsUrl } from "./utils-prod.js";
import { fetchGraduation } from "./graduation-prod.ts";
declare module "./student-common.ts" {
@@ -58,7 +58,7 @@ async function _fetchStudents() {
async function fetchStudents(idFilter?: number, nameFilter?: string) {
if (students === null) {
const studentsPromise = _fetchStudents();
- const storedStudents = localStorage.getItem("students");
+ const storedStudents = localStorage.getItem(`students-${getCourseId()}`);
if (storedStudents !== null && storedStudents.length > 0) {
studentsPromise.then((fetched) => localStorage.setItem("students", JSON.stringify(fetched)));
students = [];