Skip to content

Commit

Permalink
feat: Get role from Chrome storage and set dom string
Browse files Browse the repository at this point in the history
  • Loading branch information
kordwarshuis committed Jan 28, 2024
1 parent 3681f15 commit 06731d7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions public/js/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ function loadCollections() {
}
document.getElementById('container-collection').innerHTML = domString;
});

chrome.storage.local.get(['role'], function (result) {
let domStringRole = '';

switch (result.role) {
case 'decisionmaker':
domStringRole = 'Your role: Decision maker';
break;
case 'normaluser':
domStringRole = 'Your role: Normal user';
break;
default:
domStringRole = 'No role found';
break;
}

document.getElementById('container-role').innerHTML = domStringRole;
});
}

// Log button
Expand Down

0 comments on commit 06731d7

Please sign in to comment.