aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cockpit/js/cockpit.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/cockpit/js/cockpit.js b/cockpit/js/cockpit.js
index e2f07b2..de0f3ed 100644
--- a/cockpit/js/cockpit.js
+++ b/cockpit/js/cockpit.js
@@ -195,7 +195,12 @@ async function fetchAndUpdateStudentInfo() {
updateStudentInfo();
}
+let DEFAULT_STUDENT_ICON;
+
function updateStudentInfo() {
+ // Reset the student icon
+ document.getElementById("student-info-icon").src = DEFAULT_STUDENT_ICON;
+
// Try to replace the generic icon with the user's icon
var img = document.createElement('img');
img.onload = function() {
@@ -288,6 +293,7 @@ async function initCockpit() {
window.onload = function() {
isTeacher = getIsTeacher();
+ DEFAULT_STUDENT_ICON = document.getElementById("student-info-icon").src;
initCurrentName();
initCockpit(isTeacher);
}