diff --git a/src/page-circle.pug b/src/page-circle.pug index 1015a5b..b66986c 100644 --- a/src/page-circle.pug +++ b/src/page-circle.pug @@ -1,26 +1,26 @@ .views-container #circle-chat include page-circle-chat.pug - #circle-profile - include page-circle-profile.pug - #circle-edit - include page-circle-edit.pug - #circle-create - include page-circle-create.pug -nav.jsRightMenu(role='navigation') - sib-router(default-route='circle-chat') - ul - li.jsOffsiteToggle - a Fold menu - sib-route(name='circle-chat') - li - a Chat - sib-route(name='circle-profile') - li - a Information - sib-route(name='circle-edit') - //- li - //- a Edit - sib-route(name='circle-create') - //- li - //- a Add new \ No newline at end of file + //- #circle-profile + //- include page-circle-profile.pug + //- #circle-edit + //- include page-circle-edit.pug + //- #circle-create + //- include page-circle-create.pug +//- nav.jsRightMenu(role='navigation') +//- sib-router(default-route='circle-chat') +//- ul +//- li.jsOffsiteToggle +//- a Fold menu +//- sib-route(name='circle-chat') +//- li +//- a Chat +//- sib-route(name='circle-profile') +//- li +//- a Information +//- sib-route(name='circle-edit') +//- //- li +//- //- a Edit +//- sib-route(name='circle-create') +//- //- li +//- //- a Add new \ No newline at end of file diff --git a/src/scripts/index.js b/src/scripts/index.js index 621808e..105b5cf 100644 --- a/src/scripts/index.js +++ b/src/scripts/index.js @@ -35,15 +35,16 @@ document.addEventListener('DOMContentLoaded', function (event) { }); }); - //- Header login hide/show - // if(document.querySelector('sib-auth').getUser() !== null) { - // document.querySelector('button[role="log in"]').style.display = 'none'; - // //- Token expired, hack for ask relogin - // if(new Date(document.querySelector('sib-auth').getUser().expires_at*1000) <= new Date()) { - // document.querySelector('button[role="log in"]').style.display = ''; - // document.querySelector('button[role="log in"]').style.color = 'red'; - // document.querySelector('button[role="log in"]').innerHTML = 'Re-login'; - // } - // } + document.querySelector('sib-auth').getUser().then(user => { + if(user !== null) { + document.querySelector('button[role="log in"]').style.display = 'none'; + //- Token expired, hack for ask relogin + if(new Date(document.querySelector('sib-auth').getUser().expires_at*1000) <= new Date()) { + document.querySelector('button[role="log in"]').style.display = ''; + document.querySelector('button[role="log in"]').style.color = 'red'; + document.querySelector('button[role="log in"]').innerHTML = 'Re-login'; + } + } + }).catch(error => console.log(error)); }); \ No newline at end of file