aboutsummaryrefslogtreecommitdiff
path: root/cockpit/js/cockpit.js
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2026-05-28 22:23:28 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2026-05-28 22:23:28 +0200
commit83238bd1d7c55a87ae2169f9e97411774c41b270 (patch)
tree90db9a86f7b2264840489ab139294c72ed8c200d /cockpit/js/cockpit.js
parentad23947bf1b763d1f33d9495c192c31e2144506a (diff)
downloadbycs-sol-83238bd1d7c55a87ae2169f9e97411774c41b270.tar.gz
bycs-sol-83238bd1d7c55a87ae2169f9e97411774c41b270.zip
cockpit: use the user icon if it is available and fix URL discovery
Diffstat (limited to 'cockpit/js/cockpit.js')
-rw-r--r--cockpit/js/cockpit.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/cockpit/js/cockpit.js b/cockpit/js/cockpit.js
index f701706..30fc2a0 100644
--- a/cockpit/js/cockpit.js
+++ b/cockpit/js/cockpit.js
@@ -197,7 +197,14 @@ async function fetchAndUpdateStudentInfo() {
}
function updateStudentInfo() {
- document.getElementById("student-info-icon").src = student.getIconUrl();
+ // Try to replace the generic icon with the user's icon
+ var img = document.createElement('img');
+ img.onload = function() {
+ document.getElementById("student-info-icon").src = img.src;
+ img = img.onload = null;
+ };
+ student.getIconUrl().then( (url) => img.src = url );
+
document.getElementById("student-info-name").innerHTML = `${student.name}`;
if (student.graduation) {