From 5c018b3f2c2c47371546d210240836057d1ea5bb Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 Jun 2018 22:02:19 +0200 Subject: set menu dropdown from url. make pix2pix views --- app/client/system/system.reducer.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/client/system/system.reducer.js') diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js index 5067acd..d83fa21 100644 --- a/app/client/system/system.reducer.js +++ b/app/client/system/system.reducer.js @@ -43,6 +43,8 @@ const systemInitialState = { stderr: "", } +import modules from '../modules' + const systemReducer = (state = systemInitialState, action) => { let processor = null switch(action.type) { @@ -130,9 +132,18 @@ const systemReducer = (state = systemInitialState, action) => { } case types.system.load_site: document.querySelector('title').innerHTML = action.site.name + '.cortex' + let tool = state.site.tool + const path = window.location.pathname.split('/')[1] + if (path in modules) { + tool = path + } return { ...state, site: action.site, + app: { + ...state.app, + tool: tool, + } } case types.system.running_command: return { -- cgit v1.2.3-70-g09d2