update: resolve !150
This commit is contained in:
parent
c72ff3f6c1
commit
93895d166f
@ -52,6 +52,10 @@ nav#main__menu
|
|||||||
widget-name='sib-display-div',
|
widget-name='sib-display-div',
|
||||||
widget-badge='hd-counter'
|
widget-badge='hd-counter'
|
||||||
action-badge='badge'
|
action-badge='badge'
|
||||||
|
search-fields='team'
|
||||||
|
search-widget-team='sib-form-hidden'
|
||||||
|
search-value-team=''
|
||||||
|
set-user-id='search-value-team'
|
||||||
order-by='name'
|
order-by='name'
|
||||||
next='circle'
|
next='circle'
|
||||||
)
|
)
|
||||||
|
@ -37,12 +37,11 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
|||||||
|
|
||||||
document.querySelector('sib-auth').getUser().then(user => {
|
document.querySelector('sib-auth').getUser().then(user => {
|
||||||
if(user !== null) {
|
if(user !== null) {
|
||||||
|
// Hide login button if already logged
|
||||||
document.querySelector('button[role="log in"]').style.display = 'none';
|
document.querySelector('button[role="log in"]').style.display = 'none';
|
||||||
//- Token expired, hack for ask relogin
|
// Set current user id on set-user-id of sib-display
|
||||||
if(new Date(document.querySelector('sib-auth').getUser().expires_at*1000) <= new Date()) {
|
for(sibDisplay of document.querySelectorAll('sib-display[set-user-id]')) {
|
||||||
document.querySelector('button[role="log in"]').style.display = '';
|
sibDisplay.setAttribute(sibDisplay.getAttribute('set-user-id'), user['@id']);
|
||||||
document.querySelector('button[role="log in"]').style.color = 'red';
|
|
||||||
document.querySelector('button[role="log in"]').innerHTML = 'Re-login';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch(error => console.log(error));
|
}).catch(error => console.log(error));
|
||||||
|
Loading…
Reference in New Issue
Block a user