From 9ed74bcc08055f1378e34bf7c466538765b2dccf Mon Sep 17 00:00:00 2001
From: mgabdev <>
Date: Sat, 17 Aug 2019 01:35:29 -0400
Subject: [PATCH] Updated sidebar to be disabled if no current user
---
app/javascript/gabsocial/components/sidebar_menu.js | 5 +++++
app/javascript/gabsocial/features/ui/index.js | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/app/javascript/gabsocial/components/sidebar_menu.js b/app/javascript/gabsocial/components/sidebar_menu.js
index 7539557d..370c85c4 100644
--- a/app/javascript/gabsocial/components/sidebar_menu.js
+++ b/app/javascript/gabsocial/components/sidebar_menu.js
@@ -58,6 +58,8 @@ class SidebarMenu extends ImmutablePureComponent {
};
componentDidUpdate () {
+ if (!me) return;
+
if (this.props.sidebarOpen) {
document.body.classList.add('with-modals--active');
} else {
@@ -67,6 +69,9 @@ class SidebarMenu extends ImmutablePureComponent {
render () {
const { sidebarOpen, onClose, intl, account } = this.props;
+
+ if (!me || !account) return null;
+
const acct = account.get('acct');
const classes = classNames('sidebar-menu__root', {
diff --git a/app/javascript/gabsocial/features/ui/index.js b/app/javascript/gabsocial/features/ui/index.js
index 43c18ede..51f0431d 100644
--- a/app/javascript/gabsocial/features/ui/index.js
+++ b/app/javascript/gabsocial/features/ui/index.js
@@ -540,7 +540,7 @@ class UI extends React.PureComponent {
-
+ { me && }
);