Fixed contrast mode in the URL.

This commit is contained in:
Filip Barl
2019-05-23 16:22:46 +02:00
parent f8c7196cef
commit 765d9a06ac
3 changed files with 7 additions and 10 deletions

View File

@@ -699,11 +699,12 @@ export function receiveNotFound(nodeId, requestTimestamp) {
}
export function setContrastMode(enabled) {
return (dispatch) => {
return (dispatch, getState) => {
dispatch({
enabled,
type: ActionTypes.TOGGLE_CONTRAST_MODE,
});
updateRoute(getState);
};
}

View File

@@ -13,19 +13,12 @@ import {
class Footer extends React.Component {
constructor(props, context) {
super(props, context);
this.handleContrastClick = this.handleContrastClick.bind(this);
this.handleRelayoutClick = this.handleRelayoutClick.bind(this);
}
handleContrastClick(ev) {
handleContrastClick = (ev) => {
ev.preventDefault();
this.props.setContrastMode(!this.props.contrastMode);
}
handleRelayoutClick(ev) {
handleRelayoutClick = (ev) => {
ev.preventDefault();
trackAnalyticsEvent('scope.layout.refresh.click', {
layout: this.props.topologyViewMode,

View File

@@ -692,6 +692,9 @@ export function rootReducer(state = initialState, action) {
if (action.state.gridSortedDesc !== undefined) {
state = state.set('gridSortedDesc', action.state.gridSortedDesc);
}
if (action.state.contrastMode !== undefined) {
state = state.set('contrastMode', action.state.contrastMode);
}
if (action.state.showingNetworks) {
state = state.set('showingNetworks', action.state.showingNetworks);
}