From 6234cde19c7a40bac38f7b9db232766970072358 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 13 Jan 2021 18:46:28 -0500 Subject: [PATCH] Added shortcuts back to sidebar (visible to PRO only for now) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - shortcuts back to sidebar (visible to PRO only for now) --- app/controllers/api/v1/timelines/list_controller.rb | 2 +- .../gabsocial/components/sidebar/default_sidebar.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/timelines/list_controller.rb b/app/controllers/api/v1/timelines/list_controller.rb index 20960d13..65e7244f 100644 --- a/app/controllers/api/v1/timelines/list_controller.rb +++ b/app/controllers/api/v1/timelines/list_controller.rb @@ -9,7 +9,7 @@ class Api::V1::Timelines::ListController < Api::BaseController after_action :insert_pagination_headers, unless: -> { @statuses.empty? } def show - render json: [], + render json: set_statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user.account_id) end diff --git a/app/javascript/gabsocial/components/sidebar/default_sidebar.js b/app/javascript/gabsocial/components/sidebar/default_sidebar.js index 3f140377..cd10cf09 100644 --- a/app/javascript/gabsocial/components/sidebar/default_sidebar.js +++ b/app/javascript/gabsocial/components/sidebar/default_sidebar.js @@ -21,7 +21,9 @@ class DefaultSidebar extends ImmutablePureComponent { } componentDidMount() { - // this.props.onFetchShortcuts() + if (this.props.isPro) { + this.props.onFetchShortcuts() + } } handleOpenSidebarMorePopover = () => { @@ -154,6 +156,7 @@ const mapStateToProps = (state) => ({ notificationCount: state.getIn(['notifications', 'unread']), unreadChatsCount: state.getIn(['chats', 'chatsUnreadCount']), homeItemsQueueCount: state.getIn(['timelines', 'home', 'totalQueuedItemsCount']), + isPro: state.getIn(['accounts', me, 'is_pro']), }) const mapDispatchToProps = (dispatch) => ({