From a2e76d6898d8c84c89ddb1b18caf2a835439c9e8 Mon Sep 17 00:00:00 2001 From: Deluan Date: Mon, 9 Nov 2020 15:31:05 -0500 Subject: [PATCH] Add flag to enable activity menu --- conf/configuration.go | 2 ++ server/app/serve_index.go | 1 + ui/src/App.js | 4 +++- ui/src/config.js | 1 + ui/src/layout/AppBar.js | 3 ++- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/configuration.go b/conf/configuration.go index bfe7296b..44bb10d7 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -51,6 +51,7 @@ type configOptions struct { DevPreCacheAlbumArtwork bool DevDisableTrackCoverArt bool DevOldCacheLayout bool + DevActivityMenu bool } type scannerOptions struct { @@ -138,6 +139,7 @@ func init() { viper.SetDefault("devprecachealbumartwork", false) viper.SetDefault("devoldcachelayout", false) viper.SetDefault("devdisabletrackcoverart", false) + viper.SetDefault("devactivitymenu", false) } func InitConfig(cfgFile string) { diff --git a/server/app/serve_index.go b/server/app/serve_index.go index 20a29495..1cce76bf 100644 --- a/server/app/serve_index.go +++ b/server/app/serve_index.go @@ -34,6 +34,7 @@ func serveIndex(ds model.DataStore, fs http.FileSystem) http.HandlerFunc { "welcomeMessage": policy.Sanitize(conf.Server.UIWelcomeMessage), "enableTranscodingConfig": conf.Server.EnableTranscodingConfig, "gaTrackingId": conf.Server.GATrackingID, + "devActivityMenu": conf.Server.DevActivityMenu, } j, err := json.Marshal(appConfig) if err != nil { diff --git a/ui/src/App.js b/ui/src/App.js index 57d4b32b..059716e6 100644 --- a/ui/src/App.js +++ b/ui/src/App.js @@ -59,7 +59,9 @@ const App = () => ( const Admin = (props) => { const dispatch = useDispatch() - startEventStream((data) => dispatch(processEvent(data))) + if (config.devActivityMenu) { + startEventStream((data) => dispatch(processEvent(data))) + } return ( ({ root: { @@ -87,7 +88,7 @@ const CustomUserMenu = ({ onClick, ...rest }) => { return ( <> - + {config.devActivityMenu && }