From 4209e582df4e448fd8faaa473371832cdd3f26d8 Mon Sep 17 00:00:00 2001 From: David Meza Date: Wed, 25 Oct 2017 18:03:49 -0500 Subject: [PATCH] Clean up code and keep TabBar.jsx stateless --- src/browser/components/MainPage.jsx | 4 +++- src/browser/components/SettingsPage.jsx | 3 +-- src/browser/components/TabBar.jsx | 7 +++---- src/browser/index.jsx | 1 + src/common/config/base.json | 6 ++---- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/browser/components/MainPage.jsx b/src/browser/components/MainPage.jsx index 4786919ed93..77dd454b2ba 100644 --- a/src/browser/components/MainPage.jsx +++ b/src/browser/components/MainPage.jsx @@ -24,7 +24,8 @@ const MainPage = createReactClass({ initialIndex: PropTypes.number.isRequired, useSpellChecker: PropTypes.bool.isRequired, onSelectSpellCheckerLocale: PropTypes.func.isRequired, - deeplinkingUrl: PropTypes.string + deeplinkingUrl: PropTypes.string, + showAddServerButton: PropTypes.bool.isRequired }, getInitialState() { @@ -258,6 +259,7 @@ const MainPage = createReactClass({ activeKey={this.state.key} onSelect={this.handleSelect} onAddServer={this.addServer} + showAddServerButton={this.props.showAddServerButton} /> ); diff --git a/src/browser/components/SettingsPage.jsx b/src/browser/components/SettingsPage.jsx index 6f759b76109..5cf554adead 100644 --- a/src/browser/components/SettingsPage.jsx +++ b/src/browser/components/SettingsPage.jsx @@ -399,8 +399,7 @@ const SettingsPage = createReactClass({ ); } - var shouldShowDarwinTray = this.state.allowDarwinIconTray && process.platform === 'darwin'; - if (process.platform === 'linux' || shouldShowDarwinTray) { + if (process.platform === 'darwin' || process.platform === 'linux') { options.push( { let unreadCount = 0; @@ -55,7 +53,7 @@ function TabBar(props) { { badgeDiv } ); }); - if (AppConfig.data.enableMultiTeams === true) { + if (props.showAddServerButton === true) { tabs.push( , document.getElementById('content') ); diff --git a/src/common/config/base.json b/src/common/config/base.json index ba5d8b34a85..7666272674e 100644 --- a/src/common/config/base.json +++ b/src/common/config/base.json @@ -13,8 +13,7 @@ "spellCheckerLocale": "en-US", "helpLink": "https://docs.mattermost.com/help/apps/desktop-guide.html", "enableMultiTeams": true, - "enableServerManagement": true, - "allowDarwinIconTray": true + "enableServerManagement": true }, "1": { "teams": [], @@ -30,7 +29,6 @@ "spellCheckerLocale": "en-US", "helpLink": "https://docs.mattermost.com/help/apps/desktop-guide.html", "enableMultiTeams": true, - "enableServerManagement": true, - "allowDarwinIconTray": true + "enableServerManagement": true } }