diff --git a/static/js/com/custom-html.js b/static/js/com/custom-html.js index eb3426bb..aed1b559 100644 --- a/static/js/com/custom-html.js +++ b/static/js/com/custom-html.js @@ -65,6 +65,10 @@ export class CustomHtml extends LitElement { this.loadedHtml = this.html return } + if (!session.ctzn?.blob) { + this.currentError = "Custom HTML could not be loaded. If you are not logged in, please join a server to see this profile." + return + } try { let base64buf = (await session.ctzn.blob.get(this.userId, this.blobName))?.buf if (base64buf) this.loadedHtml = decodeBase64(base64buf) diff --git a/static/js/com/header.js b/static/js/com/header.js index c1a36a5c..64676b92 100644 --- a/static/js/com/header.js +++ b/static/js/com/header.js @@ -9,6 +9,8 @@ import { CreateCommunityPopup } from './popups/create-community.js' import * as toast from './toast.js' import './button.js' +import {DEFAULT_CITIZEN_PROFILE_SECTIONS} from '../lib/const.js' + const CHECK_NOTIFICATIONS_INTERVAL = 10e3 export class Header extends LitElement { @@ -31,11 +33,15 @@ export class Header extends LitElement { this.isMenuOpen = false this.unreadNotificationsCount = 0 this.community = undefined + this.sections = DEFAULT_CITIZEN_PROFILE_SECTIONS + document.body.addEventListener('open-main-menu', e => { this.isMenuOpen = true }) setInterval(this.checkNotifications.bind(this), CHECK_NOTIFICATIONS_INTERVAL) - session.onChange(() => this.requestUpdate()) + session.onChange(() => this.requestUpdate()) + session.onSecondaryState(() => this.requestUpdate()) + // TODO make sure sections are reloaded on 'profile-updated' } firstUpdated () { @@ -95,6 +101,7 @@ export class Header extends LitElement { Communities + ${info ? html`