aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/database-prod.ts2
-rw-r--r--src/student-prod.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/database-prod.ts b/src/database-prod.ts
index d41e829..6712adb 100644
--- a/src/database-prod.ts
+++ b/src/database-prod.ts
@@ -31,7 +31,7 @@ let graduationDb = findGraduationDb();
const ID_QUERY_PARAM_REGEX = /[?&]id=(\d+)/;
async function findGraduationDb() {
- let graduationDbId = localStorage.getItem("gruaduationDbId");
+ let graduationDbId = localStorage.getItem(`gruaduationDbId-${getCourseId()}`);
if (graduationDbId !== null) {
return new DB(Number(graduationDbId));
}
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 = [];