diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ac98a90..8d864dc2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file. ### Fixed - UI fix where multi-line text in pills would not be underlined properly on small screens. - UI fix to align footer columns +- Guests can now use the favicon to toggle additional info about the site bing viewed (such as in public embeds). ## v1.4.1 diff --git a/assets/js/dashboard/site-switcher.js b/assets/js/dashboard/site-switcher.js index 54c7385c7..56111eede 100644 --- a/assets/js/dashboard/site-switcher.js +++ b/assets/js/dashboard/site-switcher.js @@ -54,6 +54,8 @@ export default class SiteSwitcher extends React.Component { } handleKeydown(e) { + if (!this.props.loggedIn) return; + const { site } = this.props; const { sites } = this.state; @@ -82,20 +84,21 @@ export default class SiteSwitcher extends React.Component { open: !prevState.open })) - if (!this.state.sites) { + if (this.props.loggedIn && !this.state.sites) { this.populateSites(); } } renderSiteLink(domain, index) { const extraClass = domain === this.props.site.domain ? 'font-medium text-gray-900 dark:text-gray-100 cursor-default font-bold' : 'hover:bg-gray-100 dark:hover:bg-gray-900 hover:text-gray-900 dark:hover:text-gray-100 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-900 focus:text-gray-900 dark:focus:text-gray-100' + const showHotkey = !this.props.loggedIn return ( {domain} - {index < 9 && {index+1}} + {showHotkey ? index < 9 && {index+1} : null} ) } @@ -116,11 +119,22 @@ export default class SiteSwitcher extends React.Component { } } + /** + * Render a dropdown regardless of whether the user is logged in or not. In case they are not logged in (such as in an embed), the dropdown merely contains the current domain name. + */ renderDropdown() { if (this.state.loading) { return
} else if (this.state.error) { return
Something went wrong, try again
+ } else if (!this.props.loggedIn) { + return ( + +
+ { [this.props.site.domain].map(this.renderSiteLink.bind(this)) } +
+
+ ) } else { return (