Combine window hiding

This commit is contained in:
Jordan Eldredge 2018-07-11 21:02:40 -07:00
parent 4f9767bd2a
commit bc75d6efb9
3 changed files with 7 additions and 21 deletions

View file

@ -12,8 +12,7 @@ import {
TOGGLE_WINDOW,
CLOSE_WINDOW,
TOGGLE_WINDOW_SHADE_MODE,
HIDE_WINDOW,
SHOW_WINDOW
SET_WINDOW_VISIBILITY
} from "../actionTypes";
import { getPositionDiff } from "../resizeUtils";
@ -85,11 +84,11 @@ export function closeWindow(windowId) {
}
export function hideWindow(windowId) {
return { type: HIDE_WINDOW, windowId };
return { type: SET_WINDOW_VISIBILITY, windowId, hidden: true };
}
export function showWindow(windowId) {
return { type: SHOW_WINDOW, windowId };
return { type: SET_WINDOW_VISIBILITY, windowId, hidden: false };
}
export function setWindowSize(windowId, size) {

View file

@ -68,6 +68,5 @@ export const REGISTER_VISUALIZER = "REGISTER_VISUALIZER";
export const SET_Z_INDEX = "SET_Z_INDEX";
export const DISABLE_MARQUEE = "DISABLE_MARQUEE";
export const SET_DUMMY_VIZ_DATA = "SET_DUMMY_VIZ_DATA";
export const HIDE_WINDOW = "HIDE_WINDOW";
export const SHOW_WINDOW = "SHOW_WINDOW";
export const SET_WINDOW_VISIBILITY = "SET_WINDOW_VISIBILITY";
export const LOADING = "LOADING";

View file

@ -3,8 +3,7 @@ import {
SET_FOCUSED_WINDOW,
TOGGLE_WINDOW,
CLOSE_WINDOW,
HIDE_WINDOW,
SHOW_WINDOW,
SET_WINDOW_VISIBILITY,
ADD_GEN_WINDOW,
UPDATE_WINDOW_POSITIONS,
WINDOW_SIZE_CHANGED,
@ -99,25 +98,14 @@ const windows = (state = defaultWindowsState, action) => {
}
}
};
case HIDE_WINDOW:
case SET_WINDOW_VISIBILITY:
return {
...state,
genWindows: {
...state.genWindows,
[action.windowId]: {
...state.genWindows[action.windowId],
hidden: true
}
}
};
case SHOW_WINDOW:
return {
...state,
genWindows: {
...state.genWindows,
[action.windowId]: {
...state.genWindows[action.windowId],
hidden: true
hidden: action.hidden
}
}
};