Used get-headname

This commit is contained in:
Patrick Alvin Alcala 2026-01-05 17:48:45 +08:00
parent 69bd18184a
commit 611d54dd17
2 changed files with 9 additions and 1 deletions

View file

@ -11,6 +11,7 @@ import './Index.sass'
let assessorsNameList: string[]
let registeredNameList: string[]
let headName: string
export default () => {
const getAssessors = async () => {
@ -26,6 +27,12 @@ export default () => {
sessionStorage.setItem('registered', JSON.stringify([...registeredNameList]))
}
const getHead = async () => {
const head = await getApi('get-headname')
headName = head
sessionStorage.setItem('head', headName)
}
const clearCache = async () => {
caches.keys()
}
@ -34,6 +41,7 @@ export default () => {
await clearCache()
await getAssessors()
await getRegistered()
await getHead()
})
return (

View file

@ -8,7 +8,7 @@ import { checkConnection, getApi, securePassword } from '../../utils/functions'
import './Login.sass'
export default () => {
const APPROVERNAME = import.meta.env.VITE_HEAD
const APPROVERNAME = sessionStorage.getItem('head')
const navigate = useNavigate()
const assessors = JSON.parse(sessionStorage.getItem('registered')!)
const roles = ['Assessor', 'Approver']