fix card hub not being showed
This commit is contained in:
+6
-9
@@ -52,7 +52,6 @@
|
|||||||
font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
|
font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
body { visibility: hidden; }
|
|
||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
max-width: 384px;
|
max-width: 384px;
|
||||||
@@ -222,12 +221,13 @@
|
|||||||
|
|
||||||
function showApps(user) {
|
function showApps(user) {
|
||||||
loginDiv.style.display = 'none';
|
loginDiv.style.display = 'none';
|
||||||
appsDiv.style.display = '';
|
appsDiv.style.display = 'block';
|
||||||
greeting.textContent = 'Ciao ' + (user.display_name || user.handle);
|
greeting.textContent = 'Ciao ' + (user.display_name || user.handle);
|
||||||
cardsDiv.innerHTML = '';
|
cardsDiv.innerHTML = '';
|
||||||
if (user.activity_access)
|
// activity_access/wiki_access not in CurrentUserResponse yet — default to true
|
||||||
|
if (user.activity_access !== false)
|
||||||
cardsDiv.appendChild(appCard('BincioActivity', 'Tracks, strade e numeri', ACTIVITY_URL));
|
cardsDiv.appendChild(appCard('BincioActivity', 'Tracks, strade e numeri', ACTIVITY_URL));
|
||||||
if (user.wiki_access)
|
if (user.wiki_access !== false)
|
||||||
cardsDiv.appendChild(appCard('BincioWiki', 'La memoria collettiva del gruppo', WIKI_URL));
|
cardsDiv.appendChild(appCard('BincioWiki', 'La memoria collettiva del gruppo', WIKI_URL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,11 +237,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
fetch('/api/me', { credentials: 'include' })
|
fetch('/api/me', { credentials: 'include' })
|
||||||
.then(async r => {
|
.then(async r => { if (r.ok) showApps(await r.json()); })
|
||||||
document.body.style.visibility = '';
|
.catch(() => {});
|
||||||
if (r.ok) showApps(await r.json());
|
|
||||||
})
|
|
||||||
.catch(() => { document.body.style.visibility = ''; });
|
|
||||||
|
|
||||||
form.addEventListener('submit', async e => {
|
form.addEventListener('submit', async e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user